|
|
|
|
|
|
|
|
{{ auth }} |
|
|
{{ auth }} |
|
|
{% endfor -%} |
|
|
{% endfor -%} |
|
|
{% else %} |
|
|
{% else %} |
|
|
- contents: | |
|
|
|
|
|
{%- for key_name, pillar_name in user['ssh_auth_pillar'].iteritems() %} |
|
|
|
|
|
{{ salt['pillar.get'](pillar_name + ':' + key_name + ':pubkey', '') }} |
|
|
|
|
|
|
|
|
{%- for key_name, pillar_name in user['ssh_auth_pillar'].items() %} |
|
|
|
|
|
- contents_pillar: {{ pillar_name }}:{{ key_name }}:pubkey |
|
|
{%- endfor %} |
|
|
{%- endfor %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{%- endfor %} |
|
|
{%- endfor %} |
|
|
{%- endif %} |
|
|
{%- endif %} |
|
|
{%- if 'sudo_rules' in user %} |
|
|
{%- if 'sudo_rules' in user %} |
|
|
|
|
|
######################################################################## |
|
|
|
|
|
# File managed by Salt (users-formula). |
|
|
|
|
|
# Your changes will be overwritten. |
|
|
|
|
|
######################################################################## |
|
|
|
|
|
# |
|
|
{%- for rule in user['sudo_rules'] %} |
|
|
{%- for rule in user['sudo_rules'] %} |
|
|
{{ name }} {{ rule }} |
|
|
{{ name }} {{ rule }} |
|
|
{%- endfor %} |
|
|
{%- endfor %} |
|
|
|
|
|
|
|
|
- require: |
|
|
- require: |
|
|
- file: users_sudoer-defaults |
|
|
- file: users_sudoer-defaults |
|
|
- file: users_sudoer-{{ name }} |
|
|
- file: users_sudoer-{{ name }} |
|
|
cmd.wait: |
|
|
|
|
|
|
|
|
cmd.wait: |
|
|
- name: visudo -cf {{ users.sudoers_dir }}/{{ name }} || ( rm -rvf {{ users.sudoers_dir }}/{{ name }}; exit 1 ) |
|
|
- name: visudo -cf {{ users.sudoers_dir }}/{{ name }} || ( rm -rvf {{ users.sudoers_dir }}/{{ name }}; exit 1 ) |
|
|
- watch: |
|
|
|
|
|
- file: {{ users.sudoers_dir }}/{{ name }} |
|
|
|
|
|
|
|
|
- watch: |
|
|
|
|
|
- file: {{ users.sudoers_dir }}/{{ name }} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% else %} |
|
|
{% else %} |
|
|
users_{{ users.sudoers_dir }}/{{ name }}: |
|
|
users_{{ users.sudoers_dir }}/{{ name }}: |