forked from jakub/ansible
test
This commit is contained in:
8
test.yml
8
test.yml
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user