Add 'ssh_auth_file' pillar key to generate an authorized_keys file from given ssh public keys.

This commit is contained in:
root committed 2015-02-12 23:09:56 +01:00
1 parent e39a9537ba
commit fdc2fc2dfc
2 files changed
+16

No files matched your search

+12
View File
@@ -167,6 +167,18 @@ ssh_auth_delete_{{ name }}_{{ loop.index0 }}:
{% endfor %}
{% endif %}
{% if 'ssh_auth_file' in user %}
{{ home }}/.ssh/authorized_keys:
file.managed:
- user: {{ name }}
- group: {{ name }}
- mode: 600
- contents: |
{% for auth in user.ssh_auth_file -%}
{{ auth }}
{% endfor -%}
{% endif %}
{% if 'sudouser' in user and user['sudouser'] %}
sudoer-{{ name }}: