Sfoglia il codice sorgente

handle ssh authorized keys via template

master
parent
commit
1414cb206a
2 ha cambiato i file con 5 aggiunte e 2 eliminazioni
  1. +2
    -2
      tasks/main.yml
  2. +3
    -0
      templates/ssh_authorized_keys.j2

+ 2
- 2
tasks/main.yml Vedi File

@@ -55,8 +55,8 @@
with_items: "{{ users.keys() }}"

- name: ssh authorized keys
copy:
content: "{{ users[item].authorized_keys }}"
template:
src: ssh_authorized_keys.j2
dest: "{{ users[item].home | default('/home/'+item) }}/.ssh/authorized_keys"
owner: "{{ item }}"
group: "{{ item }}"


+ 3
- 0
templates/ssh_authorized_keys.j2 Vedi File

@@ -0,0 +1,3 @@
{% for key in users[item].authorized_keys %}
{{ key }}
{% endfor %}

Loading…
Annulla
Salva