cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1551
Views
0
Helpful
4
Replies

Anible Cisco output creating empty

Only output from the first command is written to the file.

How do I make it write output from all of the commands to the file?

---

- name: run show commands
  hosts: nexus1
  gather_facts: False


  tasks:
  - name: run show commands on nexus
    nxos_command:
      commands:
        - show hostname
        - show ip route
        - show interface
        - show ip interface vrf all 
        - show hsrp
    register: output

  - name: Copy to server
    copy:
      content: "{{ output.stdout[0] }}"
      dest: "/home/CiscoOutPut/{{ inventory_hostname }}.txt"
4 Replies 4

procreateapp
Level 1
Level 1

Thanks for share this information this information help me about Anible Cisco output creating empty. 

procreate app

 

 

Thanks for the information, I will try to figure it out for more. Keep sharing such informative post keep suggesting such post.

 

scoresense32
Level 1
Level 1

I appreciate for supplying this amazing knowledge! Your blogs are humorous. Very useful and easy to read!

kmfusa12
Level 1
Level 1

This is a fantastic post. It was quite necessary. Your straightforward approach to explanation is wonderful.