From e1ce837059cffe188826c749e33994488afa80f6 Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 30 Nov 2022 15:22:54 +0100 Subject: [PATCH] fix user switch --- hetzner/autoinstall/tasks/unlock.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hetzner/autoinstall/tasks/unlock.yml b/hetzner/autoinstall/tasks/unlock.yml index 2280149..bfbcc49 100644 --- a/hetzner/autoinstall/tasks/unlock.yml +++ b/hetzner/autoinstall/tasks/unlock.yml @@ -23,5 +23,5 @@ - name: set ansible_user set_fact: - ansible_ssh_user: "{{ bootstrap_user|default('root') }}" - when: connection_test is succeeded + ansible_ssh_user: "{{ ansible_user }}" + when: connection_test.rc == 0