Always update password and overwrite keys

This commit is contained in:
Sam A. 2022-11-15 19:57:17 +01:00
parent 5b2e2c0f60
commit fc0c0c5036
Signed by untrusted user: samsapti
GPG key ID: CBBBE7371E81C4EA

View file

@ -4,22 +4,20 @@
name: "{{ item.name }}"
comment: "{{ item.comment }}"
password: "{{ item.password }}"
update_password: "on_create"
groups: "{{ item.groups }}"
groups: "{{ item.groups }}"
update_password: "always"
loop: "{{ users | default([]) }}"
- name: "Add ssh authorized_keys"
authorized_key:
user: "{{ item.0.name }}"
key: "{{ item.1 }}"
with_subelements:
- "{{ users | default([]) }}"
- keys
user: "{{ item.name }}"
key: "{{ item.keys | join('\n') }}"
exclusive: true
loop: "{{ users | default([]) }}"
- name: "Add ssh authorized_keys to root user"
authorized_key:
user: "root"
key: "{{ item.1 }}"
with_subelements:
- "{{ users | default([]) }}"
- keys
key: "{{ item.keys | join('\n') }}"
exclusive: true
loop: "{{ users | default([]) }}"