Skip to content

Commit b9e3c57

Browse files
committed
replace inventory_hostname with ansible_host
1 parent 560668e commit b9e3c57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tasks/before.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@
1010
wait_for:
1111
port: '{{ ansible_port }}'
1212
state: started
13-
host: '{{ inventory_hostname }}'
13+
host: '{{ ansible_host }}'
1414
connect_timeout: 5
1515
timeout: 10
1616
become: false
1717
delegate_to: localhost
18-
ignore_errors: yes
18+
ignore_errors: true
1919
register: ssh_hardening_fallback_inventory_port_check
2020

2121
- name: Inventory port reachable.
@@ -33,7 +33,7 @@
3333
wait_for:
3434
port: '22'
3535
state: started
36-
host: '{{ inventory_hostname }}'
36+
host: '{{ ansible_host }}'
3737
connect_timeout: 5
3838
timeout: 10
3939
become: false
@@ -45,7 +45,7 @@
4545
- name: Fallback ansible_port to default 22 (to be restored at the end).
4646
block:
4747
- debug:
48-
msg: Falling back from port {{ ansible_port }} to port 22.
48+
msg: Falling back from port {{ ansible_port }} to port 22.
4949
- name: Flag that we're falling back to port 22.
5050
set_fact:
5151
ssh_hardening_fallback_use22: true

0 commit comments

Comments
 (0)