Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

asa_command

ANSIBLE VERSION

Both latest stable & unstable versions:

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]```

CONFIGURATION

inventory = ./hosts

library = /home/actionmystique/Ansible/git-yang-networkop/ansible-101/library

forks = 1000

gathering = explicit

gather_timeout = 10

roles_path = /home/actionmystique/Ansible/Roles/roles

private_role_vars = yes

hash_behaviour = merge

log_path = /var/log/ansible.log

retry_files_enabled = False

show_custom_stats = True

timeout = 10

pipelining = True

connect_timeout = 30

connect_retries = 30

connect_interval = 1

OS / ENVIRONMENT

host: Ubuntu 16.10 4.8

target:

ASAv 9.5(2)

ASAv 9.6(2)

SUMMARY

cf. title, for instance with any show command.

STEPS TO REPRODUCE

Structure passed as "provider": connections.ssh

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

Role: asa_pull_config:

- 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

Playbook:

- 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' }

EXPECTED RESULTS

Startup & running configurations of the target ASAv node.

ACTUAL RESULTS

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
<172.21.100.231> ESTABLISH LOCAL CONNECTION FOR USER: root
<172.21.100.231> EXEC /bin/sh -c '/usr/bin/python && sleep 0'
The full traceback is:
Traceback (most recent call last):
File "/tmp/ansible__7xZ8h/ansible_module_asa_command.py", line 229, in <module>
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! => {
"changed": false,
"failed": true,
"module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible__7xZ8h/ansible_module_asa_command.py\", line 229, in <module>\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
}

No issue when sshing into the ASAv from the linux terminal:

# ssh admin@172.21.100.231Type help or '?' for a list of available commands.
ASAv1> en
Password: **********
ASAv1#

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

asa_command

ANSIBLE VERSION

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)]

CONFIGURATION

roles_path = /Users/brandon.strohmeyer/Desktop/Repository/netops/roles

log_path = /Users/brandon.strohmeyer/Desktop/Documents/Logs/ansible.log

[paramiko_connection]

look_for_keys=False

OS / ENVIRONMENT

OS X 10.12.3

SUMMARY

MODULE FAILURE when using asa_command in stable-2.3 and devel. Exact same playbook succeeds when using 2.2.

STEPS TO REPRODUCE

Run asa_command module in any playbook on 2.3 or devel.

---
- name: FIND OPERATING SYSTEM
register: os_version
asa_command:
commands:
- "show version | include Cisco"
authorize: yes
provider: "{{ provider }}"

- debug:
var: os_version.stdout_lines[0][0]

EXPECTED RESULTS

No traceback

ACTUAL RESULTS

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] => {"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] => {"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 <module>
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! => {
"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 <module>\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
}