Fix updating ssh keys before user exists
This commit is contained in:
parent
fa0df823ee
commit
538bb26f83
@ -81,12 +81,6 @@
|
||||
state: present
|
||||
gid: 1400
|
||||
|
||||
- name: Update ansible user authorized keys
|
||||
ansible.posix.authorized_key:
|
||||
user: ansible
|
||||
exclusive: true
|
||||
key: "{{ skylab_mgmt_keys | join('\n') }}"
|
||||
|
||||
- name: Generate ansible user account password
|
||||
delegate_to: localhost
|
||||
no_log: true
|
||||
@ -110,6 +104,12 @@
|
||||
uid: 1400
|
||||
password: "{{ _password_ansible.stdout }}"
|
||||
|
||||
- name: Update ansible user authorized keys
|
||||
ansible.posix.authorized_key:
|
||||
user: ansible
|
||||
exclusive: true
|
||||
key: "{{ skylab_mgmt_keys | join('\n') }}"
|
||||
|
||||
- name: Remove ansible user group
|
||||
ansible.builtin.group:
|
||||
name: ansible
|
||||
|
Reference in New Issue
Block a user