|
|
|
|
|
|
|
|
{% endfor %} |
|
|
{% endfor %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{% if 'ssh_auth_file' in user %} |
|
|
|
|
|
|
|
|
{% if 'ssh_auth_file' in user or 'ssh_auth_pillar' in user %} |
|
|
users_authorized_keys_{{ name }}: |
|
|
users_authorized_keys_{{ name }}: |
|
|
file.managed: |
|
|
file.managed: |
|
|
- name: {{ home }}/.ssh/authorized_keys |
|
|
- name: {{ home }}/.ssh/authorized_keys |
|
|
- user: {{ name }} |
|
|
- user: {{ name }} |
|
|
- group: {{ name }} |
|
|
- group: {{ name }} |
|
|
- mode: 600 |
|
|
- mode: 600 |
|
|
|
|
|
{% if 'ssh_auth_file' in user %} |
|
|
- contents: | |
|
|
- contents: | |
|
|
{% for auth in user.ssh_auth_file -%} |
|
|
{% for auth in user.ssh_auth_file -%} |
|
|
{{ auth }} |
|
|
{{ auth }} |
|
|
{% endfor -%} |
|
|
{% endfor -%} |
|
|
|
|
|
{% else %} |
|
|
|
|
|
- contents: | |
|
|
|
|
|
{%- for key_name, pillar_name in user['ssh_auth_pillar'].items() %} |
|
|
|
|
|
{{ salt['pillar.get'](pillar_name + ':' + key_name + ':pubkey', '') }} |
|
|
|
|
|
{%- endfor %} |
|
|
|
|
|
{% endif %} |
|
|
{% endif %} |
|
|
{% endif %} |
|
|
|
|
|
|
|
|
{% if 'ssh_auth' in user %} |
|
|
{% if 'ssh_auth' in user %} |