<h5 dir="auto">ISSUE TYPE</h5>
<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>
<p dir="auto">asa_command</p>
<h5 dir="auto">ANSIBLE VERSION</h5>
<p dir="auto">Both latest stable &amp; unstable versions:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0-1
ansible 2.4.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/actionmystique/Ansible/git-yang-networkop/ansible-101/library']
  python version = 2.7.12+ (default, Sep 17 2016, 12:08:02) [GCC 6.2.0 20160914]```"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0-1
ansible 2.4.0
  config file = /etc/ansible/ansible.cfg
  configured module search path = [u'/home/actionmystique/Ansible/git-yang-networkop/ansible-101/library']
  python version = 2.7.12+ (default, Sep 17 2016, 12:08:02) [GCC 6.2.0 20160914]```
</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>
<p dir="auto">inventory   = ./hosts<br>
library        = /home/actionmystique/Ansible/git-yang-networkop/ansible-101/library<br>
forks = 1000<br>
gathering = explicit<br>
gather_timeout = 10<br>
roles_path = /home/actionmystique/Ansible/Roles/roles<br>
private_role_vars = yes<br>
hash_behaviour = merge<br>
log_path = /var/log/ansible.log<br>
retry_files_enabled = False<br>
show_custom_stats = True<br>
timeout = 10<br>
pipelining = True<br>
connect_timeout = 30<br>
connect_retries = 30<br>
connect_interval = 1</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>
<ul dir="auto">
<li>host: Ubuntu 16.10 4.8</li>
<li>target:
<ul dir="auto">
<li><strong>ASAv 9.5(2)</strong></li>
<li><strong>ASAv 9.6(2)</strong></li>
</ul>
</li>
</ul>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">cf. title, for instance with any show command.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>
<p dir="auto">Structure passed as "<strong>provider</strong>": connections.ssh</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="connections
...
        ssh:
          transport: cli 
          host: &quot;{{ ansible_host }}&quot;
          # ansible_port
          port: 22
          # ansible_user
          username: admin
          # ansible_ssh_pass
          password: xxxxxxxxxxx
          authorize: yes
          # enable_secret_password
          auth_pass: xxxxxxxxxxx
          # private_key_file
          ssh_keyfile: &quot;~/.ssh/id_rsa&quot;
          version: 2
          timeout: 10"><pre class="notranslate"><code class="notranslate">connections
...
        ssh:
          transport: cli 
          host: "{{ ansible_host }}"
          # ansible_port
          port: 22
          # ansible_user
          username: admin
          # ansible_ssh_pass
          password: xxxxxxxxxxx
          authorize: yes
          # enable_secret_password
          auth_pass: xxxxxxxxxxx
          # private_key_file
          ssh_keyfile: "~/.ssh/id_rsa"
          version: 2
          timeout: 10
</code></pre></div>
<p dir="auto"><strong>Role</strong>: asa_pull_config:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- include_vars: &quot;../defaults/{{ os_family }}/connections.yml&quot;
  when: (connections is undefined)

- name: Fetching config from the remote node
  asa_command:
        provider: &quot;{{ connections.ssh }}&quot;
        commands:
          - &quot;show {{ config }}&quot;
  register: configuration"><pre class="notranslate"><code class="notranslate">- include_vars: "../defaults/{{ os_family }}/connections.yml"
  when: (connections is undefined)

- name: Fetching config from the remote node
  asa_command:
        provider: "{{ connections.ssh }}"
        commands:
          - "show {{ config }}"
  register: configuration
</code></pre></div>
<p dir="auto"><strong>Playbook</strong>:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="- name: Pulling ASA/ASAv startup and running configs
  hosts:
    - asav
  roles:
    - { role: asa_pull_config, config: startup-config, with_date_time: 'no' }
    - { role: asa_pull_config, config: running-config, with_date_time: 'no' }"><pre class="notranslate"><code class="notranslate">- name: Pulling ASA/ASAv startup and running configs
  hosts:
    - asav
  roles:
    - { role: asa_pull_config, config: startup-config, with_date_time: 'no' }
    - { role: asa_pull_config, config: running-config, with_date_time: 'no' }
</code></pre></div>
<h5 dir="auto">EXPECTED RESULTS</h5>
<p dir="auto">Startup &amp; running configurations of the target ASAv node.</p>
<h5 dir="auto">ACTUAL RESULTS</h5>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="TASK [asa_pull_config : Fetching config from the remote node] ***************************************************************************************************************
task path: /home/actionmystique/Ansible/Roles/roles/asa_pull_config/tasks/main.yml:77
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/network/asa/asa_command.py
&lt;172.21.100.231&gt; ESTABLISH LOCAL CONNECTION FOR USER: root
&lt;172.21.100.231&gt; EXEC /bin/sh -c '/usr/bin/python &amp;&amp; sleep 0'
The full traceback is:
Traceback (most recent call last):
  File &quot;/tmp/ansible__7xZ8h/ansible_module_asa_command.py&quot;, line 229, in &lt;module&gt;
    main()
  File &quot;/tmp/ansible__7xZ8h/ansible_module_asa_command.py&quot;, line 180, in main
    runner = CommandRunner(module)
  File &quot;/tmp/ansible__7xZ8h/ansible_modlib.zip/ansible/module_utils/netcli.py&quot;, line 140, in __init__
AttributeError: 'Cli' object has no attribute 'default_output'

fatal: [ASAv1]: FAILED! =&gt; {
    &quot;changed&quot;: false, 
    &quot;failed&quot;: true, 
    &quot;module_stderr&quot;: &quot;Traceback (most recent call last):\n  File \&quot;/tmp/ansible__7xZ8h/ansible_module_asa_command.py\&quot;, line 229, in &lt;module&gt;\n    main()\n  File \&quot;/tmp/ansible__7xZ8h/ansible_module_asa_command.py\&quot;, line 180, in main\n    runner = CommandRunner(module)\n  File \&quot;/tmp/ansible__7xZ8h/ansible_modlib.zip/ansible/module_utils/netcli.py\&quot;, line 140, in __init__\nAttributeError: 'Cli' object has no attribute 'default_output'\n&quot;, 
    &quot;module_stdout&quot;: &quot;&quot;, 
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;, 
    &quot;rc&quot;: 1
}"><pre class="notranslate"><code class="notranslate">TASK [asa_pull_config : Fetching config from the remote node] ***************************************************************************************************************
task path: /home/actionmystique/Ansible/Roles/roles/asa_pull_config/tasks/main.yml:77
Using module file /usr/local/lib/python2.7/dist-packages/ansible/modules/network/asa/asa_command.py
&lt;172.21.100.231&gt; ESTABLISH LOCAL CONNECTION FOR USER: root
&lt;172.21.100.231&gt; EXEC /bin/sh -c '/usr/bin/python &amp;&amp; sleep 0'
The full traceback is:
Traceback (most recent call last):
  File "/tmp/ansible__7xZ8h/ansible_module_asa_command.py", line 229, in &lt;module&gt;
    main()
  File "/tmp/ansible__7xZ8h/ansible_module_asa_command.py", line 180, in main
    runner = CommandRunner(module)
  File "/tmp/ansible__7xZ8h/ansible_modlib.zip/ansible/module_utils/netcli.py", line 140, in __init__
AttributeError: 'Cli' object has no attribute 'default_output'

fatal: [ASAv1]: FAILED! =&gt; {
    "changed": false, 
    "failed": true, 
    "module_stderr": "Traceback (most recent call last):\n  File \"/tmp/ansible__7xZ8h/ansible_module_asa_command.py\", line 229, in &lt;module&gt;\n    main()\n  File \"/tmp/ansible__7xZ8h/ansible_module_asa_command.py\", line 180, in main\n    runner = CommandRunner(module)\n  File \"/tmp/ansible__7xZ8h/ansible_modlib.zip/ansible/module_utils/netcli.py\", line 140, in __init__\nAttributeError: 'Cli' object has no attribute 'default_output'\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE", 
    "rc": 1
}
</code></pre></div>
<p dir="auto">No issue when sshing into the ASAv from the linux terminal:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="# ssh admin@172.21.100.231Type help or '?' for a list of available commands.
ASAv1&gt; en
Password: **********
ASAv1# "><pre class="notranslate"><code class="notranslate"># ssh admin@172.21.100.231Type help or '?' for a list of available commands.
ASAv1&gt; en
Password: **********
ASAv1# 
</code></pre></div>
<h5 dir="auto">ISSUE TYPE</h5>

<ul dir="auto">
<li>Bug Report</li>
</ul>
<h5 dir="auto">COMPONENT NAME</h5>

<p dir="auto">asa_command</p>
<h5 dir="auto">ANSIBLE VERSION</h5>

<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ansible 2.3.0.0
  config file = /Users/brandon.strohmeyer/Desktop/Repository/netops/ansible.cfg
  configured module search path = [u'/library/']
  python version = 2.7.10 (default, Jul 30 2016, 19:40:32) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]
"><pre class="notranslate"><code class="notranslate">ansible 2.3.0.0
  config file = /Users/brandon.strohmeyer/Desktop/Repository/netops/ansible.cfg
  configured module search path = [u'/library/']
  python version = 2.7.10 (default, Jul 30 2016, 19:40:32) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.34)]

</code></pre></div>
<h5 dir="auto">CONFIGURATION</h5>

<p dir="auto">roles_path    = /Users/brandon.strohmeyer/Desktop/Repository/netops/roles<br>
log_path = /Users/brandon.strohmeyer/Desktop/Documents/Logs/ansible.log<br>
[paramiko_connection]<br>
look_for_keys=False</p>
<h5 dir="auto">OS / ENVIRONMENT</h5>

<p dir="auto">OS X 10.12.3</p>
<h5 dir="auto">SUMMARY</h5>
<p dir="auto">MODULE FAILURE when using asa_command in stable-2.3 and devel. Exact same playbook succeeds when using 2.2.</p>
<h5 dir="auto">STEPS TO REPRODUCE</h5>

<p dir="auto">Run asa_command module in any playbook on 2.3 or devel.</p>

<div class="highlight highlight-source-yaml notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="---
- name: FIND OPERATING SYSTEM
  register: os_version
  asa_command:
    commands:
      - &quot;show version | include Cisco&quot;
    authorize: yes
    provider: &quot;{{ provider }}&quot;
    
- debug:
    var: os_version.stdout_lines[0][0]"><pre class="notranslate">---
- <span class="pl-ent">name</span>: <span class="pl-s">FIND OPERATING SYSTEM</span>
  <span class="pl-ent">register</span>: <span class="pl-s">os_version</span>
  <span class="pl-ent">asa_command</span>:
    <span class="pl-ent">commands</span>:
      - <span class="pl-s"><span class="pl-pds">"</span>show version | include Cisco<span class="pl-pds">"</span></span>
    <span class="pl-ent">authorize</span>: <span class="pl-s">yes</span>
    <span class="pl-ent">provider</span>: <span class="pl-s"><span class="pl-pds">"</span>{{ provider }}<span class="pl-pds">"</span></span>
    
- <span class="pl-ent">debug</span>:
    <span class="pl-ent">var</span>: <span class="pl-s">os_version.stdout_lines[0][0]</span></pre></div>

<h5 dir="auto">EXPECTED RESULTS</h5>

<p dir="auto">No traceback</p>
<h5 dir="auto">ACTUAL RESULTS</h5>


<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="2017-03-29 14:08:25,239 p=10899 u=brandon.strohmeyer |  Using /Users/brandon.strohmeyer/Desktop/Repository/netops/ansible.cfg as config file
2017-03-29 14:08:27,017 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Application Support/ApplePushService'

2017-03-29 14:08:27,018 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Application Support/com.apple.TCC'

2017-03-29 14:08:27,018 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Application Support/Wireshark'

2017-03-29 14:08:27,019 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Caches/com.apple.iconservices.store'

2017-03-29 14:08:27,060 p=10899 u=brandon.strohmeyer |  Loading callback plugin default of type stdout, v2.0 from /Library/Python/2.7/site-packages/ansible/plugins/callback/__init__.pyc
2017-03-29 14:08:27,071 p=10899 u=brandon.strohmeyer |  PLAYBOOK: asatest.yaml ******************************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,072 p=10899 u=brandon.strohmeyer |  1 plays in playbooks/asatest.yaml
2017-03-29 14:08:27,073 p=10899 u=brandon.strohmeyer |  PLAY [asa-firewall] **************************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,088 p=10899 u=brandon.strohmeyer |  META: ran handlers
2017-03-29 14:08:27,089 p=10899 u=brandon.strohmeyer |  TASK [login : GET SECRETS] **************************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,089 p=10899 u=brandon.strohmeyer |  task path: /Users/brandon.strohmeyer/Desktop/Repository/netops/roles/login/tasks/main.yaml:1
2017-03-29 14:08:27,176 p=10899 u=brandon.strohmeyer |  ok: [asa-firewall] =&gt; {&quot;censored&quot;: &quot;the output has been hidden due to the fact that 'no_log: true' was specified for this result&quot;}
2017-03-29 14:08:27,178 p=10899 u=brandon.strohmeyer |  TASK [login : SET LOGIN VARIABLES] ******************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,178 p=10899 u=brandon.strohmeyer |  task path: /Users/brandon.strohmeyer/Desktop/Repository/netops/roles/login/tasks/main.yaml:5
2017-03-29 14:08:27,208 p=10899 u=brandon.strohmeyer |  ok: [asa-firewall] =&gt; {&quot;censored&quot;: &quot;the output has been hidden due to the fact that 'no_log: true' was specified for this result&quot;}
2017-03-29 14:08:27,211 p=10899 u=brandon.strohmeyer |  TASK [asatest : FIND OPERATING SYSTEM] **************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,211 p=10899 u=brandon.strohmeyer |  task path: /Users/brandon.strohmeyer/Desktop/Repository/netops/roles/asatest/tasks/main.yaml:4
2017-03-29 14:08:27,345 p=10899 u=brandon.strohmeyer |  Using module file /Library/Python/2.7/site-packages/ansible/modules/network/asa/asa_command.py
2017-03-29 14:08:27,573 p=10899 u=brandon.strohmeyer |  The full traceback is:
Traceback (most recent call last):
  File &quot;/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py&quot;, line 229, in &lt;module&gt;
    main()
  File &quot;/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py&quot;, line 180, in main
    runner = CommandRunner(module)
  File &quot;/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_modlib.zip/ansible/module_utils/netcli.py&quot;, line 140, in __init__
AttributeError: 'Cli' object has no attribute 'default_output'

2017-03-29 14:08:27,573 p=10899 u=brandon.strohmeyer |  fatal: [asa-firewall]: FAILED! =&gt; {
    &quot;changed&quot;: false, 
    &quot;failed&quot;: true, 
    &quot;module_stderr&quot;: &quot;Traceback (most recent call last):\n  File \&quot;/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py\&quot;, line 229, in &lt;module&gt;\n    main()\n  File \&quot;/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py\&quot;, line 180, in main\n    runner = CommandRunner(module)\n  File \&quot;/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_modlib.zip/ansible/module_utils/netcli.py\&quot;, line 140, in __init__\nAttributeError: 'Cli' object has no attribute 'default_output'\n&quot;, 
    &quot;module_stdout&quot;: &quot;&quot;, 
    &quot;msg&quot;: &quot;MODULE FAILURE&quot;, 
    &quot;rc&quot;: 0
}

"><pre class="notranslate"><code class="notranslate">2017-03-29 14:08:25,239 p=10899 u=brandon.strohmeyer |  Using /Users/brandon.strohmeyer/Desktop/Repository/netops/ansible.cfg as config file
2017-03-29 14:08:27,017 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Application Support/ApplePushService'

2017-03-29 14:08:27,018 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Application Support/com.apple.TCC'

2017-03-29 14:08:27,018 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Application Support/Wireshark'

2017-03-29 14:08:27,019 p=10899 u=brandon.strohmeyer |   [WARNING]: Error accessing plugin paths: [Errno 13] Permission denied: '/library/Caches/com.apple.iconservices.store'

2017-03-29 14:08:27,060 p=10899 u=brandon.strohmeyer |  Loading callback plugin default of type stdout, v2.0 from /Library/Python/2.7/site-packages/ansible/plugins/callback/__init__.pyc
2017-03-29 14:08:27,071 p=10899 u=brandon.strohmeyer |  PLAYBOOK: asatest.yaml ******************************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,072 p=10899 u=brandon.strohmeyer |  1 plays in playbooks/asatest.yaml
2017-03-29 14:08:27,073 p=10899 u=brandon.strohmeyer |  PLAY [asa-firewall] **************************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,088 p=10899 u=brandon.strohmeyer |  META: ran handlers
2017-03-29 14:08:27,089 p=10899 u=brandon.strohmeyer |  TASK [login : GET SECRETS] **************************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,089 p=10899 u=brandon.strohmeyer |  task path: /Users/brandon.strohmeyer/Desktop/Repository/netops/roles/login/tasks/main.yaml:1
2017-03-29 14:08:27,176 p=10899 u=brandon.strohmeyer |  ok: [asa-firewall] =&gt; {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
2017-03-29 14:08:27,178 p=10899 u=brandon.strohmeyer |  TASK [login : SET LOGIN VARIABLES] ******************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,178 p=10899 u=brandon.strohmeyer |  task path: /Users/brandon.strohmeyer/Desktop/Repository/netops/roles/login/tasks/main.yaml:5
2017-03-29 14:08:27,208 p=10899 u=brandon.strohmeyer |  ok: [asa-firewall] =&gt; {"censored": "the output has been hidden due to the fact that 'no_log: true' was specified for this result"}
2017-03-29 14:08:27,211 p=10899 u=brandon.strohmeyer |  TASK [asatest : FIND OPERATING SYSTEM] **************************************************************************************************************************************************************************************************************
2017-03-29 14:08:27,211 p=10899 u=brandon.strohmeyer |  task path: /Users/brandon.strohmeyer/Desktop/Repository/netops/roles/asatest/tasks/main.yaml:4
2017-03-29 14:08:27,345 p=10899 u=brandon.strohmeyer |  Using module file /Library/Python/2.7/site-packages/ansible/modules/network/asa/asa_command.py
2017-03-29 14:08:27,573 p=10899 u=brandon.strohmeyer |  The full traceback is:
Traceback (most recent call last):
  File "/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py", line 229, in &lt;module&gt;
    main()
  File "/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py", line 180, in main
    runner = CommandRunner(module)
  File "/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_modlib.zip/ansible/module_utils/netcli.py", line 140, in __init__
AttributeError: 'Cli' object has no attribute 'default_output'

2017-03-29 14:08:27,573 p=10899 u=brandon.strohmeyer |  fatal: [asa-firewall]: FAILED! =&gt; {
    "changed": false, 
    "failed": true, 
    "module_stderr": "Traceback (most recent call last):\n  File \"/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py\", line 229, in &lt;module&gt;\n    main()\n  File \"/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_module_asa_command.py\", line 180, in main\n    runner = CommandRunner(module)\n  File \"/var/folders/hg/13g74tv53b35h72wyk3r7phm0000gp/T/ansible_JTzF9i/ansible_modlib.zip/ansible/module_utils/netcli.py\", line 140, in __init__\nAttributeError: 'Cli' object has no attribute 'default_output'\n", 
    "module_stdout": "", 
    "msg": "MODULE FAILURE", 
    "rc": 0
}


</code></pre></div>