Which method use 'wait_for' to check open ports?

132 views
Skip to first unread message

Leandro Montesoro

unread,
Mar 1, 2023, 2:00:58 PM3/1/23
to Ansible Project
Hi ! 

i'm making a playbook like this:

- name: Check all port numbers are accessible from current host
wait_for:
host: "{{ item[0] }}"
port: "{{ item[1] }}"
state: started
delay: 0
timeout: 3
delegate_to: localhost
become: false
ignore_errors: no
ignore_unreachable: yes
register: result
failed_when: not result.failed
with_nested:
- "{{ ansible_default_ipv4.address }}"
- [443,80,9200,9300,22,5432,6432]





The result informs that 1 of my ports in public ip it's open, i'll check in my host and its true, but it has an rule to drop all the trafic over port 22. Beyond it, the playbook informs ok, but when i'll try to scan this por with nmap or telnet the result its the port its close. My question is ¿what is the method used for 'wait_for' to check the ports?

thanks a lot  !

Rowe, Walter P. (Fed)

unread,
Mar 1, 2023, 2:05:48 PM3/1/23
to ansible...@googlegroups.com
The code is open source. You can read the ansible modules on GitHub.



Walter
--
Walter Rowe, Division Chief
Infrastructure Services, OISM
Mobile: 202.355.4123

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/fddf8ea4-6948-431b-8dfb-467c04c4d0e9n%40googlegroups.com.

Reply all
Reply to author
Forward
0 new messages