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 }}"
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:
argv:
- sshpass
- -e
- ssh
- -i
- /path/to/id_rsa # sem dej cestu k privátnímu klíči v kontejneru
- -o
- StrictHostKeyChecking=no
- -o
- ConnectTimeout=5
- "{{ vm_user }}@{{ item.ip }}"
- "echo OK-from-{{ item.ip }}"
environment:
SSHPASS: "{{ vm_pass }}"
loop: "{{ vm_targets }}"
register: ssh_results
ignore_errors: true