Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # bash commands to reproduce ansible problem with 'delegate_to' in 'synchronize'
- # edit 'host1' and 'host2', run on a separate host3
- #
- mkdir -p /tmp/tst/a
- ssh host1 mkdir -p /tmp/tst/a/b
- cat >/tmp/tst/sync-test.yml <<EOF
- ---
- # Test "delegate_to:" in synchronize action (RUN ON host3!)
- - name: ensure soldev in sync with master
- hosts: host2
- remote_user: root
- tasks:
- - name: syncronize /tmp/tst tree (should be from host1)
- synchronize: >
- src=/tmp/tst/ dest=/tmp/tst
- delegate_to: host1
- EOF
- ansible-playbook -vv /tmp/tst/sync-test.yml
- ssh host2 find /tmp/tst
- # see presence of /tmp/tst/sync-test.yml, and absense of /tmp/tst/a/b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement