Created
October 27, 2014 05:45
-
-
Save RickyCook/42c55959298f41faba07 to your computer and use it in GitHub Desktop.
Ansible rsync changed status
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
# Uses the rsync change summary to figure out how many things changed, and uses that | |
# to tell Ansible if something changed or not | |
- name: sync hieradata | |
shell: rsync --delete -ri "/tmp/repo/hieradata" "/etc/puppet/hieradata" | awk '{print $1}' | grep -vE '..\.\..\.\.\.\.' | wc -l | |
register: hieradata_changes | |
changed_when: "hieradata_changes.stdout|int != 0" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Awesome! This was a huge help. I'd not have bothered to figure it out, but it makes me happy.
Thanks.