Guest User

Untitled

a guest
May 21st, 2018
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. - name: check server online or not
  2. hosts: localhost
  3. connection: local
  4.  
  5. tasks:
  6. - name: check ESXI host connection to port 443
  7. wait_for: host=ams-server-101 port=443 timeout=1
  8. register: command_result
  9. failed_when: "'Timeout' not in command_result"
  10.  
  11. - debug: var=command_result
  12.  
  13. shell: echo "QUIT" | nc -w 3 ams-server-101 443 > /dev/null 2>&1 && echo Pass || echo Fail
  14. register: shell_result
  15. failed_when: shell_result.stdout == "Pass"
Add Comment
Please, Sign In to add comment