据我所知,我们可以使用ping模块使用Ansible ping主机。但是,ping模块尝试ssh到主机以ping它。有没有办法做到这一点,而不必ssh?有点像活体检查?
答案 0 :(得分:0)
你想看到一个端口已启动?当然,你想要wait_for
。
- name: is your fridge running?
wait_for:
host: 1.2.3.4 # or hostvars[inventory_hostname]['ansible_default_ipv4']['address']
port: 22
timeout: 300 # will try for 5 mins
state: present