File tree 2 files changed +5
-24
lines changed
2 files changed +5
-24
lines changed Original file line number Diff line number Diff line change 1
- ssh_retries : 100
1
+ ssh_timeout : 600
2
2
ssh_retry_delay : 6
3
- host : " {{ hostvars[inventory_hostname]['ansible_host'] | default(inventory_hostname) }}"
Original file line number Diff line number Diff line change 1
- - block :
2
- - name : verify that configured SSH private key is a file and has permissions of 0600
3
- local_action : file path="{{ ansible_ssh_private_key_file }}" state=file mode=0600
4
- tags :
5
- - skip_ansible_lint
6
-
7
- - name : construct command line for SSH check
8
- set_fact :
9
- check_ssh_cmd : >-
10
- ansible --ssh-extra-args='-o StrictHostKeyChecking=no'
11
- -i '{{ inventory_dir }}/{{ (inventory_file | string | default('')) | basename }}'
12
- {{ host }} -m ping
13
-
14
- - name : check for SSH connectivity and authentication
15
- local_action : shell {{ check_ssh_cmd }}
16
- register : result
17
- changed_when : " result.rc != 0"
18
- until : result.rc == 0
19
- retries : " {{ ssh_retries }}"
20
- delay : " {{ ssh_retry_delay }}"
21
- tags :
22
- - skip_ansible_lint
1
+ - name : wait for ssh connection
2
+ wait_for_connection :
3
+ sleep : ' {{ ssh_retry_delay }}'
4
+ timeout : ' {{ ssh_timeout }}'
23
5
when : ansible_connection == 'ssh'
You can’t perform that action at this time.
0 commit comments