From 538bb26f831be3ce85f0e2d74a452fcf08624751 Mon Sep 17 00:00:00 2001 From: Ethan Paul Date: Mon, 10 Apr 2023 17:53:14 -0400 Subject: [PATCH] Fix updating ssh keys before user exists --- skylab/infra/playbooks/bootstrap.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/skylab/infra/playbooks/bootstrap.yml b/skylab/infra/playbooks/bootstrap.yml index 099b0b0..58d4d37 100644 --- a/skylab/infra/playbooks/bootstrap.yml +++ b/skylab/infra/playbooks/bootstrap.yml @@ -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