---- hosts: web14 remote_user: jlouthan tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' register: timestamp run_once: true
- name: Get current datestamp local_action: command bash -c 'date +%Y-%m-%d' register: datestamp run_once: true
- name: Create test file file: path=/home/jlouthan/testing{{ timestamp.stdout }} state=touch
- name: List the file recently created shell: ls -la /home/jlouthan | grep {{ datestamp.stdout }} register: touchtest
- debug: var=touchtest.stdout_lines
- pause: prompt='Note the name of the file'
- name: Pull test file from web16 to web14 synchronize: mode=pull src=/home/jlouthan/testing{{ timestamp.stdout }} dest=/home/jlouthan/ delegate_to: web16
- name: List test files from today shell: ls -la /home/jlouthan | grep {{ datestamp.stdout }} delegate_to: web16 register: destcheck
- debug: var=destcheck.stdout_lines
- pause: prompt='Check dest test files'$ cat test-push-files.yml---- hosts: web16 remote_user: jlouthan tasks: - name: Get current timestamp local_action: command bash -c 'date +%Y-%m-%d.%H%M' register: timestamp
- name: Get current datestamp local_action: command bash -c 'date +%Y-%m-%d' register: datestamp
- name: Create test file file: path=/home/jlouthan/testing{{ timestamp.stdout }} state=touch delegate_to: web14
- name: List the file recently created shell: ls -la /home/jlouthan | grep {{ datestamp.stdout }} delegate_to: web14 register: touchtest
- debug: var=touchtest.stdout_lines
- pause: prompt='Note the name of the file'
- name: Pull test file from web14 to web16 synchronize: src=/home/jlouthan/testing{{ timestamp.stdout }} dest=/home/jlouthan delegate_to: web14PLAY ***************************************************************************TASK [setup] *******************************************************************ok: [web16]TASK [Get current timestamp] ***************************************************changed: [web16 -> localhost]TASK [Get current datestamp] ***************************************************changed: [web16 -> localhost]TASK [Create test file] ********************************************************changed: [web16 -> web14]TASK [List the file recently created] ******************************************changed: [web16 -> web14]TASK [debug] *******************************************************************ok: [web16] => {"touchtest.stdout_lines": ["-rw-r--r-- 1 jlouthan jlouthan 0 May 2 14:43 testing2016-05-02.0843","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 14:45 testing2016-05-02.0845","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 14:46 testing2016-05-02.0846","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 14:56 testing2016-05-02.0856","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 15:06 testing2016-05-02.0906","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 15:14 testing2016-05-02.0914","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 15:18 testing2016-05-02.0918","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 15:19 testing2016-05-02.0919","-rw-r--r-- 1 jlouthan jlouthan 0 May 2 15:25 testing2016-05-02.0925"]}TASK [pause] *******************************************************************[pause]Note the name of the file:ok: [web16]TASK [Pull test file from web14 to web16] **************************************fatal: [web16 -> web14]: FAILED! => {"changed": false, "cmd": "/usr/bin/rsync --delay-updates -F --compress --archive --rsh '/usr/bin/ssh -S none -o StrictHostKeyChecking=no' --out-format='<<CHANGED>>%i %n%L' \"/home/jlouthan/testing2016-05-02.0925\" \"web16:/home/jlouthan\"", "failed": true, "msg": "rsync: --out-format=<<CHANGED>>%i %n%L: unknown option\nrsync error: syntax or usage error (code 1) at main.c(1231) [client=2.6.8]\n", "rc": 1}NO MORE HOSTS LEFT *************************************************************to retry, use: --limit @test-push-files.retryPLAY RECAP *********************************************************************web16 : ok=7 changed=4 unreachable=0 failed=1
--
You received this message because you are subscribed to a topic in the Google Groups "Ansible Project" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ansible-project/R99b0yWdp88/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/5728280B.6040809%40ojkastl.de.
For more options, visit https://groups.google.com/d/optout.