Skip to content

Instantly share code, notes, and snippets.

Created June 18, 2015 09:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/c070d9349db9c035e4aa to your computer and use it in GitHub Desktop.
Save anonymous/c070d9349db9c035e4aa to your computer and use it in GitHub Desktop.
{% for usr, uid in pillar.get('users', {}).items() %}
{{ usr }}:
user:
- present
- fullname: {{ usr }}
- home: /home/{{ usr }}
- shell: /bin/bash
- uid: {{uid}}
{% if 'cacti' in usr %}
- fullname: Cacti
{% else %}
- optional_groups:
- admin
- ubuntu
- wheel
- sysadmins
- sudo
{% endif %}
ssh_auth:
- present
- user: {{ usr }}
- source: salt://users/files/{{ usr }}_id_rsa.pub
- require:
- user: {{ usr }}
{% endfor %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment