Hello Team,
I am using ios_command module in a playbook. With this module we executes
different commands (i.e. show version, show ISIS neighbor, show users
etc..) on routers and collect respective output in text file. To copy
out-put in a text file we use "copy" module. And whole playbook executed
properly for all 58 commands except 2 commands.
These 2 commands have very long((5000+ lines)) output. Because of this
playbook didn't return output of these two commands.
*Can anyone support me to collect very long output in a text file.*
I am playing with the following Playbook ::
---
- name: Device collection commands output save into file
hosts: devices
gather_facts: no
connection: local
tasks:
- file:
path: "/var/www/html/devices/assets/reports/{{ inventory_hostname }}"
state: directory
mode: 0755
- name: Run the CSPC ping command _sh_ip_bgp_vpnv4_all
eos_command:
commands:
- Terminal Length 0
- show ip bgp vpnv4 all
provider: "{{ cli }}"
register: ping_cmd
ignore_errors: yes
- name: Save the config to a file _sh_ip_bgp_vpnv4_all
copy:
content: "{{ ping_cmd.stdout[1] }}"
dest: "/var/www/html/devices/assets/reports/{{ inventory_hostname
}}/_sh_ip_bgp_vpnv4_all"
ignore_errors: yes
...
And this is a other command :: show ip bgp vpnv6 unicast all
*----------------------------------------------------------------------------------*
*If you have any reference OR respective playbook OR solution for this
scenario, then please pass me.*
*Thanks in advance for your support.*
*Thanking you.*
--
You received this message because you are subscribed to the Google Groups
"Ansible Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.