Hello Andrew,

Thank you for your reply.

I am not getting about  'redirect'  can you please elaborate it.

Thanking you.

Regards,
Satish.

On Tue, Feb 7, 2017 at 10:41 PM, Andrew Latham <[email protected]> wrote:

> This topic is likely better for the ansible-users list but on Cisco IOS
> use the 'redirect' to a txt file and grab it upon success of the 'show'.
>
> On Tue, Feb 7, 2017 at 8:41 AM, Satish <[email protected]> wrote:
>
>> 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.
>>
>
>
>
> --
> - Andrew "lathama" Latham [email protected] http://lathama.org -
>
> --
> 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.
>



-- 
If you have any suggestion / feedback, then please let us know.
--

Regards,
*Satish.*
*Please do not print this email unless absolutely necessary. Save Trees !!!*

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

Reply via email to