Skip to content

Instantly share code, notes, and snippets.

@pduersteler
Created January 3, 2015 18:42
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 pduersteler/38a17ff7be41bddadf4c to your computer and use it in GitHub Desktop.
Save pduersteler/38a17ff7be41bddadf4c to your computer and use it in GitHub Desktop.
{% 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