diff options
author | Romain Gonçalves <me@rgoncalves.se> | 2021-12-10 21:52:02 +0000 |
---|---|---|
committer | Romain Gonçalves <me@rgoncalves.se> | 2021-12-10 21:52:55 +0000 |
commit | 4c65e7d4cbc3e0bfee426c05e88690ea2a486673 (patch) | |
tree | 20e3f3d394c2f2a511ea52796492dd5d92e0fd0b | |
parent | c1c300aa21b407351e6045c7b40480d4120db8a7 (diff) | |
download | rules-4c65e7d4cbc3e0bfee426c05e88690ea2a486673.tar.gz |
roles/sshd: Pass linter + correct directory for sync
-rw-r--r-- | roles/sshd/tasks/synchronize_keys.yml (renamed from roles/sshd/tasks/sync_keys.yml) | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/roles/sshd/tasks/sync_keys.yml b/roles/sshd/tasks/synchronize_keys.yml index 73aa741..cb634a4 100644 --- a/roles/sshd/tasks/sync_keys.yml +++ b/roles/sshd/tasks/synchronize_keys.yml @@ -1,19 +1,20 @@ - name: retrieve all existing users - shell: cut -d ":" -f 1 /etc/passwd + command: cut -d ":" -f 1 /etc/passwd register: sshd_users changed_when: false -- name: bind retrieved users output lines to list +- name: convert retrieved users to list set_fact: sshd_users: "{{ sshd_users.stdout_lines }}" - name: get ssh keys for all user find: - paths: "{{ inventory_dir }}/files/pubkeys" + paths: "{{ inventory_dir }}/files/keys" pattern: "*.pub" recurse: true file_type: link register: keys + run_once: true delegate_to: localhost - name: show pubkeys |