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 }}" name: "{{ item.name }}"
comment: "{{ item.comment }}" comment: "{{ item.comment }}"
password: "{{ item.password }}" password: "{{ item.password }}"
update_password: "on_create"
groups: "{{ item.groups }}" groups: "{{ item.groups }}"
update_password: "always"
loop: "{{ users | default([]) }}" loop: "{{ users | default([]) }}"
- name: "Add ssh authorized_keys" - name: "Add ssh authorized_keys"
authorized_key: authorized_key:
user: "{{ item.0.name }}" user: "{{ item.name }}"
key: "{{ item.1 }}" key: "{{ item.keys | join('\n') }}"
with_subelements: exclusive: true
- "{{ users | default([]) }}" loop: "{{ users | default([]) }}"
- keys
- name: "Add ssh authorized_keys to root user" - name: "Add ssh authorized_keys to root user"
authorized_key: authorized_key:
user: "root" user: "root"
key: "{{ item.1 }}" key: "{{ item.keys | join('\n') }}"
with_subelements: exclusive: true
- "{{ users | default([]) }}" loop: "{{ users | default([]) }}"
- keys