Hi This worked for me.

 name: Name servers  
      ios_command: 
        authorize: yes
        provider: "{{ cli }}"
        commands: 
          - show ip name-servers
          - show run | in ntp
          - show run | in host
          - show run | in address ipv4 
          
      register: config

    - name: save output to a file
      copy: content="{{ config.stdout | replace('\\n', '\n') }}" 
dest="/opt/ansible/dev/D/verf/Log/{{ inventory_hostname }}.txt"
      
    

On Wednesday, June 2, 2021 at 10:22:08 PM UTC+10 seeku...@gmail.com wrote:

> 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.
>

-- 
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-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/825f7a1a-3942-4f34-8999-fc7b9d027554n%40googlegroups.com.

Reply via email to