From c09e37eb491395f1e782ff031bc4bd1488478fba Mon Sep 17 00:00:00 2001 From: Michael Wilson Date: Wed, 30 Nov 2022 19:00:34 +0100 Subject: [PATCH] test fix for connection context --- hetzner/autoinstall/tasks/unlock.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hetzner/autoinstall/tasks/unlock.yml b/hetzner/autoinstall/tasks/unlock.yml index d5f6178..05bb2d1 100644 --- a/hetzner/autoinstall/tasks/unlock.yml +++ b/hetzner/autoinstall/tasks/unlock.yml @@ -11,16 +11,16 @@ delegate_to: localhost - name: test ssh connection with {{ ansible_user }} - shell: | - ssh -p{{ ansible_ssh_port|default(22) }} \ - -i {{ ansible_ssh_private_key_file }} \ - -oStrictHostkeyChecking=no \ - -oBatchMode=yes \ - {{ ansible_user }}@{{ ansible_ssh_host }} echo test + local_action: + module: shell + command: | + ssh -p{{ ansible_ssh_port|default(22) }} \ + -i {{ ansible_ssh_private_key_file }} \ + -oStrictHostkeyChecking=no \ + -oBatchMode=yes \ + {{ ansible_user }}@{{ ansible_ssh_host }} echo test register: connection_test ignore_errors: yes - delegate_to: localhost - delegate_facts: yes - name: set ansible_user set_fact: