3
0
forked from jakub/ansible
This commit is contained in:
martin.fencl
2025-12-05 21:19:51 +01:00
parent bcbc0269d6
commit cb2099a802

View File

@@ -30,20 +30,18 @@
msg: "Ping to {{ item.item.ip }} -> rc={{ item.rc }}, stdout={{ item.stdout }}" msg: "Ping to {{ item.item.ip }} -> rc={{ item.rc }}, stdout={{ item.stdout }}"
loop: "{{ ping_results.results }}" loop: "{{ ping_results.results }}"
- name: Test SSH to VM with sshpass # real SSH test - name: Test SSH to VM with ssh (SSH key)
ansible.builtin.command: ansible.builtin.command:
argv: argv:
- sshpass
- -e
- ssh - ssh
- -i
- /path/to/id_rsa # sem dej cestu k privátnímu klíči v kontejneru
- -o - -o
- StrictHostKeyChecking=no - StrictHostKeyChecking=no
- -o - -o
- ConnectTimeout=5 - ConnectTimeout=5
- "{{ vm_user }}@{{ item.ip }}" - "{{ vm_user }}@{{ item.ip }}"
- "echo OK-from-{{ item.ip }}" - "echo OK-from-{{ item.ip }}"
environment:
SSHPASS: "{{ vm_pass }}"
loop: "{{ vm_targets }}" loop: "{{ vm_targets }}"
register: ssh_results register: ssh_results
ignore_errors: true ignore_errors: true