Created
May 19, 2017 20:54
-
-
Save bradynathan/8b705e232750500f83118e1cbf65f0b5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Use openssl to verify system rebooted | |
local_action: shell openssl s_client -connect {{ ansible_host }}:{{ ansible_port| default(22) }} | |
become: false | |
ignore_errors: True | |
register: openssl_test_result | |
changed_when: False | |
- name: Email notification if server is not reachable | |
local_action: > | |
mail to="{{ item }}" subject="{{ ansible_hostname }} UNREACHABLE" body='The system is unreachable after updates' | |
become: false | |
with_items: | |
- "{{ updates_failure_notification }}" | |
when: openssl_test_result.stderr.find('Connection refused') > -1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment