Support for optional_groupslookup-fix-3
gid: 500 | gid: 500 | ||||
groups: | groups: | ||||
- users | - users | ||||
optional_groups: | |||||
- some_groups_that_might | |||||
- not_exist_on_all_minions | |||||
ssh_key_type: rsa | ssh_key_type: rsa | ||||
# You can inline the private keys ... | # You can inline the private keys ... | ||||
ssh_keys: | ssh_keys: |
{% for group in user.get('groups', []) -%} | {% for group in user.get('groups', []) -%} | ||||
- {{ group }} | - {{ group }} | ||||
{% endfor %} | {% endfor %} | ||||
{% if 'optional_groups' in user %} | |||||
- optional_groups: | |||||
{% for optional_group in user['optional_groups'] -%} | |||||
- {{optional_group}} | |||||
{% endfor %} | |||||
{% endif %} | |||||
- require: | - require: | ||||
- group: {{ user_group }} | - group: {{ user_group }} | ||||
{% for group in user.get('groups', []) -%} | {% for group in user.get('groups', []) -%} |