How to copy very long(5000+ lines) out-put of commands to files

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

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

Hello Andrew,

Thank you for your reply.

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

Thanking you.

Regards,
Satish.