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 }}"
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user