Print output of multiple host in a single file

24 visualizações
Pular para a primeira mensagem não lida

R.B. Kumar

não lida,
2 de jun. de 2021, 08:22:0802/06/2021
para Ansible Project
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.

NAVEEN

não lida,
2 de jun. de 2021, 08:31:5002/06/2021
para ansible...@googlegroups.com
May be u can use with_items module.

--
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 ansible-proje...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/19f9cd6d-bf7f-46b4-a2a6-c108d2c02131n%40googlegroups.com.

R.B. Kumar

não lida,
2 de jun. de 2021, 12:39:2302/06/2021
para Ansible Project
Thank you. Let me try and let you know 

dmc...@gmail.com

não lida,
2 de jun. de 2021, 14:05:4602/06/2021
para Ansible Project
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_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.
A mensagem foi excluída

R.B. Kumar

não lida,
3 de jun. de 2021, 09:53:3703/06/2021
para Ansible Project
Thank you.  I will try today and get back. 
Responder a todos
Responder ao autor
Encaminhar
0 nova mensagem