Skip to content

Commit

Permalink
Last little fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjk committed Feb 17, 2016
1 parent 7df9558 commit c7d17e5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ Role Variables
dumpall_guest_destination: "/tmp/ansible/dump/{{ inventory_hostname }}"
dumpall_host_destination: "/tmp/ansible/dump/{{ inventory_hostname }}"

The dumpall_keep_on_guest and dumpall_keep_on_host variables let you choose where you want to keep the dump file. The default setting is to keep files only on Ansible host.
The `dumpall_keep_on_guest` and `dumpall_keep_on_host` variables let you choose where you want to keep the dump file. The default setting is to keep files only on Ansible host.

The dumpall_guest_destination variable is where the dump file is created on the target. The dumpall_host_destination is where all dumps are retrieved from target.
The `dumpall_guest_destination` variable is where the dump file is created on the target. The dumpall_host_destination` is where all dumps are retrieved from target.

All variables are mandatory, and they are documented in default/main.yml.
All variables are mandatory ( except for `dumpall_host_destination` ), and they are documented in default/main.yml.

Example Playbook
-------------------------
Expand Down
3 changes: 2 additions & 1 deletion defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dumpall_keep_on_host: yes
# destination directory must already exists.
dumpall_guest_destination: "/tmp/ansible_dump_{{ inventory_hostname }}"

# Define here where you want to retrieve the dump file on the host.
# Define here where you want to retrieve the dump file on the
# host. If this variable is not set, dumpall_keep_on_host is assumed to be False.
dumpall_host_destination: "/tmp/ansible/dump/{{ inventory_hostname }}"

5 changes: 3 additions & 2 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
assert:
that:
- dumpall_guest_destination is defined
- dumpall_host_destination is defined
- dumpall_keep_on_guest is defined
- dumpall_keep_on_host is defined

Expand All @@ -18,7 +17,9 @@
src: "{{ dumpall_guest_destination }}"
dest: "{{ dumpall_host_destination }}"
flat: True
when: dumpall_keep_on_host == True
when: >
dumpall_host_destination is defined and
dumpall_keep_on_host == True
- name: Remove dumpfile on the guest
file:
Expand Down

0 comments on commit c7d17e5

Please sign in to comment.