Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - name: check server online or not
- hosts: localhost
- connection: local
- tasks:
- - name: check ESXI host connection to port 443
- wait_for: host=ams-server-101 port=443 timeout=1
- register: command_result
- failed_when: "'Timeout' not in command_result"
- - debug: var=command_result
- shell: echo "QUIT" | nc -w 3 ams-server-101 443 > /dev/null 2>&1 && echo Pass || echo Fail
- register: shell_result
- failed_when: shell_result.stdout == "Pass"
Add Comment
Please, Sign In to add comment