Created
September 8, 2014 15:47
-
-
Save wozz/8a1506b00058a9b4c84d 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 | |
| - shell: dig +short <my home dns> @resolver1.opendns.com | |
| register: homeip | |
| - set_fact: home="{{ myip.stdout == homeip.stdout }}" | |
| - name: Update pi | |
| hosts: pi | |
| gather_facts: false | |
| tasks: | |
| - debug: msg="{{ ansible_facts.home }}" | |
| - include: tasks/update.yml | |
| when: ansible_facts.home |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment