NOT MAINTENED: This module is not maintened anymore. Feel free to fork. If you are looking for a replacement, have a look to this role: ansible-role-debug-dumpallvars
Dump all remote variables and (optionally) copy the result to a destination on the host. It is really helpful to have a dump of all variables (because the official documentation lacks of clarity on this point) and it helps a lot to debug your roles/playbooks. This role is Ansible 2.0 compatible.
Based on the excellent work by Lester Wade, and the very nice implementation of f500. This version basically fixes some minor bugs, and avoid file name collision.
Ansible 1.4 and higher. This is compatible with Ansible 2.0.
Via Ansible Galaxy:
ansible-galaxy install mrjk/ansible-role-dumpall
dumpall_keep_on_guest: no
dumpall_keep_on_host: yes
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_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 ( except for dumpall_host_destination
), and they are documented in default/main.yml.
Example without a host_destination will result in a dumpfile /tmp/ansible.all on the guest:
- hosts: servers
roles:
- dumpall
Example with a host_destination will result in a dumpfile /examine/ansible.all on the host machine: (the dumpfile on the guest is removed)
- hosts: servers
roles:
- role: dumpall
dumpall_keep_on_guest: yes
dumpall_host_destination: /tmp/my_prj
LGPL
mrjk, jeznet.org
Jasper N. Brouwer, [email protected]
Ramon de la Fuente, [email protected]