Created
September 8, 2014 16:35
-
-
Save wozz/c91426800bbaab5d81d4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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: Determine if Home | |
| hosts: localhost | |
| gather_facts: false | |
| tasks: | |
| - shell: dig +short myip.opendns.com @resolver1.opendns.com | |
| register: myip | |
| changed_when: false | |
| - shell: dig +short <home dns> @resolver1.opendns.com | |
| register: homeip | |
| changed_when: false | |
| - name: Update servers | |
| hosts: all | |
| gather_facts: false | |
| tasks: | |
| - include: tasks/update.yml | |
| when: "{{ home_ is not defined or hostvars['localhost']['homeip']['stdout'] == hostvars['localhost']['myip']['stdout'] }}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment