|
|
|
|
@ -11,14 +11,13 @@ |
|
|
|
|
delegate_to: localhost |
|
|
|
|
|
|
|
|
|
- name: test ssh connection with {{ ansible_user }} |
|
|
|
|
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 |
|
|
|
|
local_action: | |
|
|
|
|
ansible.builtin.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 |
|
|
|
|
register: connection_test |
|
|
|
|
ignore_errors: yes |
|
|
|
|
|
|
|
|
|
|