I've done something like this to create an inventory tracking spreadsheet. 
Haven't had the chance yet to improve it or convert it into a proper 
playbook. 

The setup module allows you to output facts to a tree structure with a JSON 
file for each host: 
$ ansible all -i inventory -u admin -m setup --tree hosts_facts

facts/
├── host_A
├── host_B
├── host_C
├── host_D
└── host_Z

I used a command-line utility called jq to parse the JSON. See here: 
http://xmodulo.com/how-to-parse-json-string-via-command-line-on-linux.html

Then, just had to create a bash script to go through each file and extract 
the facts that I needed into a csv:

$ cat facts/host_A | jq .ansible_facts.ansible_distribution



On Tuesday, November 3, 2015 at 2:37:39 PM UTC-5, Jon Dison wrote:
>
> I'm wondering if anyone has any existing playbooks and/or scripts to go 
> through an environment and document the findings.
>
> Basically a way to transform the results from the setup module into a 
> useful CSV would be a good start, but also adding on other facets like 
> lists of patches to be applied, etc would be very useful.
>
> I've made use of the setup module to create a directory of hosts files 
> showing the results in YAML, but transforming that into a useful report 
> would take some work and I figure someone out there may have already done 
> it.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/2b4f45fe-0d21-47fa-b530-80491846d4f3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to