Print output of multiple host in a single file

Hello All - Some basics. I have 50+ Cisco Routers. I am running a ansible script to execute “show version” command. The script works well. I am copying the output to a file

But every host creates one file so, i end up having 50+ files with the output. Can i write the output of all the host in a single file? Thanks

regards, RB.

May be u can use with_items module.

Thank you. Let me try and let you know

Have you tried Ansibledb? It seems a waste to only get one piece of information.

AnsibleDB can take in the output of the setup module and store it so you can just run curl commands against the API and pull out the version you’re after from all your cisco routers at once. in your case, you’d need to pull down (probably)this collection: https://docs.ansible.com/ansible/latest/collections/cisco/ios/ios_facts_module.html

Once it’s set up, you can query ansibleDB for any other facts you want.

AnsibleDB setup role: https://github.com/apidb-io/setup_ansibledb
OR AnsibleDB manual setup: https://github.com/apidb-io/ansibledb_api_opensource
Ansibledb_opensource ansible collection to collect the facts: https://galaxy.ansible.com/apidb/ansibledb_opensource

This is a meetup demo of the setup and usage of AnsibleDB but the focus is Linux and Windows servers but with the right collection, it will require minimal setup.
https://youtu.be/1vLe7o0BooY

I’d be happy to help with the setup.

Thank you. I will try today and get back.