Advertisement
Guest User

Untitled

a guest
May 1st, 2014
274
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.65 KB | None | 0 0
  1. # bash commands to reproduce ansible problem with 'delegate_to' in 'synchronize'
  2. # edit 'host1' and 'host2', run on a separate host3
  3. #
  4. mkdir -p /tmp/tst/a
  5. ssh host1 mkdir -p /tmp/tst/a/b
  6. cat >/tmp/tst/sync-test.yml <<EOF
  7. ---
  8. # Test "delegate_to:" in synchronize action (RUN ON host3!)
  9. - name: ensure soldev in sync with master
  10.   hosts: host2
  11.   remote_user: root
  12.   tasks:
  13.   - name: syncronize /tmp/tst tree (should be from host1)
  14.     synchronize: >
  15.       src=/tmp/tst/ dest=/tmp/tst
  16.       delegate_to: host1
  17. EOF
  18. ansible-playbook -vv /tmp/tst/sync-test.yml
  19. ssh host2 find /tmp/tst
  20. # 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