<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Ansible output truncated in Controllers</title>
    <link>https://community.cisco.com/t5/controllers/ansible-output-truncated/m-p/4160090#M2126</link>
    <description>&lt;P&gt;I am trying to create a simple "show run"/"show tech" ansible playbook and when i run it the output to the file is truncated. So I am not getting the whole config in the txt file. What is the trick to fixing this? Is it a terminal line issue or a paging issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;---

- name: Gather tech data for TAC
  hosts: cisco_routers
  tasks:
    - name: "Task 1: Get output of show tech on IOS"
      ios_command:
          commands:
            - show version
      register: command_output
     
    - name: "Task 2: Display stdout_lines[0]"
      debug: 
        msg:  "{{ command_output.stdout_lines }}"
    
    - name: "Task 3: Save output to File"
      copy: content="{{ command_output.stdout[0] }}" dest="~/GitHubRepos/Ansible-Master-Directory/output-files/{{ inventory_hostname  }}_show-tech.txt"&lt;/PRE&gt;</description>
    <pubDate>Thu, 01 Oct 2020 14:44:03 GMT</pubDate>
    <dc:creator>stevenjwilliams0728</dc:creator>
    <dc:date>2020-10-01T14:44:03Z</dc:date>
    <item>
      <title>Ansible output truncated</title>
      <link>https://community.cisco.com/t5/controllers/ansible-output-truncated/m-p/4160090#M2126</link>
      <description>&lt;P&gt;I am trying to create a simple "show run"/"show tech" ansible playbook and when i run it the output to the file is truncated. So I am not getting the whole config in the txt file. What is the trick to fixing this? Is it a terminal line issue or a paging issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;---

- name: Gather tech data for TAC
  hosts: cisco_routers
  tasks:
    - name: "Task 1: Get output of show tech on IOS"
      ios_command:
          commands:
            - show version
      register: command_output
     
    - name: "Task 2: Display stdout_lines[0]"
      debug: 
        msg:  "{{ command_output.stdout_lines }}"
    
    - name: "Task 3: Save output to File"
      copy: content="{{ command_output.stdout[0] }}" dest="~/GitHubRepos/Ansible-Master-Directory/output-files/{{ inventory_hostname  }}_show-tech.txt"&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Oct 2020 14:44:03 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/ansible-output-truncated/m-p/4160090#M2126</guid>
      <dc:creator>stevenjwilliams0728</dc:creator>
      <dc:date>2020-10-01T14:44:03Z</dc:date>
    </item>
    <item>
      <title>Re: Ansible output truncated</title>
      <link>https://community.cisco.com/t5/controllers/ansible-output-truncated/m-p/4160350#M2127</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1046025"&gt;@stevenjwilliams0728&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have you played around with the command_timeout parameter. &amp;nbsp;That has worked for me with very large configs or when pulling show commands at locations where latency is a factor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In a production environment I currently support where I was getting lots of show commands outside of the US I had that set to 120.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is an excerpt from ansible.cfg but you can also change it in other places to be more targeted. &amp;nbsp;See the link below for more info.&lt;/P&gt;&lt;PRE&gt;# Ansible Network Debug and Troubleshooting Guide
# https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html
[persistent_connection]
# 30 seconds is the new default but is included here in case adjustments are required.  Getting show run and other show commands
# from large switch stacks may require increasing this value.  I've found 45 works in many cases where I'm running
# show commands against stacks of 4-5 switch members and I've had to kick this up to 460 for high latency devices
# with very large configurations.
command_timeout = 30
# 30 seconds is the default.  Increase if you are accessing network devices across high latency links or  devices in a
# different global region
connect_timeout = 30
# 15 seconds is the default.
connect_retry_timeout = 30&lt;/PRE&gt;&lt;P&gt;&lt;A href="https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html#command-timeout" target="_blank"&gt;https://docs.ansible.com/ansible/latest/network/user_guide/network_debug_troubleshooting.html#command-timeout&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Oct 2020 21:22:06 GMT</pubDate>
      <guid>https://community.cisco.com/t5/controllers/ansible-output-truncated/m-p/4160350#M2127</guid>
      <dc:creator>Claudia de Luna</dc:creator>
      <dc:date>2020-10-01T21:22:06Z</dc:date>
    </item>
  </channel>
</rss>

