Update to 2021-12-13 19:00

This commit is contained in:
Daniel Berteaud
2021-12-13 19:00:18 +01:00
parent c699767808
commit e43d9bc96c
14 changed files with 185 additions and 148 deletions

View File

@@ -0,0 +1,13 @@
---
- name: List all authorized keys directories
shell: ls -1 /etc/ssh/authorized_keys | xargs -n1 basename
register: existing_ssh_keys
changed_when: False
tags: ssh
- name: Remove unmanaged ssh keys
file: path=/etc/ssh/authorized_keys/{{ item }} state=absent
loop: "{{ existing_ssh_keys.stdout_lines | default([]) }}"
when: item not in ssh_users | rejectattr('keys_file', 'defined') | map(attribute='name')
tags: ssh