2016-07-30 02:12:41 -04:00
|
|
|
---
|
2016-09-12 02:29:24 -04:00
|
|
|
- hosts: default:packer-test
|
2016-07-30 02:12:41 -04:00
|
|
|
gather_facts: no
|
|
|
|
tasks:
|
2016-09-25 18:57:02 -04:00
|
|
|
- name: touch /root/ansible-raw-test
|
|
|
|
raw: touch /root/ansible-raw-test
|
|
|
|
- name: raw test
|
|
|
|
raw: date
|
|
|
|
- name: command test
|
|
|
|
command: echo "the command module"
|
|
|
|
- name: prepare remote directory
|
|
|
|
command: mkdir /tmp/remote-dir
|
2016-08-29 01:22:48 -04:00
|
|
|
args:
|
2016-07-30 02:12:41 -04:00
|
|
|
creates: /tmp/remote-dir
|
2016-09-25 18:57:02 -04:00
|
|
|
- name: transfer file.txt
|
|
|
|
copy: src=dir/file.txt dest=/tmp/remote-dir/file.txt
|
|
|
|
- name: fetch file.text
|
|
|
|
fetch: src=/tmp/remote-dir/file.txt dest=fetched-dir validate=yes fail_on_missing=yes
|
|
|
|
- name: copy contents of directory
|
|
|
|
copy: src=dir/contents-only/ dest=/tmp/remote-dir
|
|
|
|
- name: fetch contents of directory
|
|
|
|
fetch: src=/tmp/remote-dir/file.txt dest="fetched-dir/{{ inventory_hostname }}/tmp/remote-dir/contents-only/" flat=yes validate=yes fail_on_missing=yes
|
|
|
|
- name: copy directory recursively
|
|
|
|
copy: src=dir/subdir dest=/tmp/remote-dir
|
|
|
|
- name: fetch recursively copied directory
|
|
|
|
fetch: src=/tmp/remote-dir/subdir/file.txt dest=fetched-dir validate=yes fail_on_missing=yes
|
2016-07-30 02:12:41 -04:00
|
|
|
- copy: src=largish-file.txt dest=/tmp/largish-file.txt
|