-
-
Save pduersteler/38a17ff7be41bddadf4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% for user, args in salt['pillar.get']('ssh:users', {}).iteritems() -%} | |
# This will end in a short declaration if nothing is given manually | |
# in a SLS. I want to define default values here. | |
# What would be the "way to go" for setting default values? | |
# Something like {% set args['shell'] = '/bin/bash' if 'shell' not in args %} for each line? | |
{{ user }}: | |
user.present: | |
{% if 'shell' in args -%} | |
- shell: {{ args['shell'] }} | |
{% endif -%} | |
{% if 'home' in args -%} | |
- home: {{ args['home'] }} | |
- createhome: True | |
{% endif -%} | |
{% if 'groups' in args %} | |
- groups: {{ args['groups'] }} | |
{% endif %} | |
{% enfor %} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment