Hi, There: I have problem to run ansible-playbook for Cisco ASA, and I manage sent user directly to enable mode by enable following command on ASA.
aaa authorization exec authentication-server auto-enable The yaml file as following, and show version is working fine. Appreciate any help. ~Mike - hosts: testfw gather_facts: no connection: local vars: cli: host: "{{ inventory_hostname }}" username: "xxx" password: "xxxxxx" authorize: no tasks: - name: Retrieve device configuration for ASA asa_command: provider: "{{ cli }}" commands: - show version timeout: 60 # register: output # - name: # debug: var=output - name: config object asa_config: lines: - network-object host 10.80.30.18 - network-object host 10.80.30.19 parents: ['object-group network dummy-server'] provider: "{{ cli }}" Here is the error ================ task path: /work/fwshowver.yaml:21 Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/basic.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/asa.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/network.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/netcfg.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/_text.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/pycompat24.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/six/__init__.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/six/_six.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/shell.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/netcli.py Using module_utils file /usr/lib/python2.7/site-packages/ansible/module_utils/network_common.py Using module file /usr/lib/python2.7/site-packages/ansible/modules/network/asa/asa_config.py <10.0.203.251> ESTABLISH LOCAL CONNECTION FOR USER: root <10.0.203.251> EXEC /bin/sh -c 'echo ~ && sleep 0' <10.0.203.251> EXEC /bin/sh -c '( umask 77 && mkdir -p "` echo /root/.ansible/tmp/ansible-tmp-1496436026.08-155161754343332 `" && echo ansible-tmp-1496436026.08-155161754343332="` echo /root/.ansible/tmp/ansible-tmp-1496436026.08-155161754343332 `" ) && sleep 0' <10.0.203.251> PUT /tmp/tmpFCbNS5 TO /root/.ansible/tmp/ansible-tmp-1496436026.08-155161754343332/asa_config.py <10.0.203.251> EXEC /bin/sh -c 'chmod u+x /root/.ansible/tmp/ansible-tmp-1496436026.08-155161754343332/ /root/.ansible/tmp/ansible-tmp-1496436026.08-155161754343332/asa_config.py && sleep 0' <10.0.203.251> EXEC /bin/sh -c '/usr/bin/python /root/.ansible/tmp/ansible-tmp-1496436026.08-155161754343332/asa_config.py; rm -rf "/root/.ansible/tmp/ansible-tmp-1496436026.08-155161754343332/" > /dev/null 2>&1 && sleep 0' The full traceback is: Traceback (most recent call last): File "/tmp/ansible_P6vlzq/ansible_module_asa_config.py", line 349, in <module> main() File "/tmp/ansible_P6vlzq/ansible_module_asa_config.py", line 341, in main run(module, result) File "/tmp/ansible_P6vlzq/ansible_module_asa_config.py", line 271, in run config = get_config(module) File "/tmp/ansible_P6vlzq/ansible_module_asa_config.py", line 251, in get_config contents = module.config.get_config(include=include) File "/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/network.py", line 98, in get_config File "/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/asa.py", line 107, in get_config File "/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/shell.py", line 284, in <lambda> File "/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/shell.py", line 274, in execute File "/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/shell.py", line 263, in to_command TypeError: __init__() takes exactly 3 arguments (2 given) fatal: [10.0.203.251]: FAILED! => { "changed": false, "failed": true, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_P6vlzq/ansible_module_asa_config.py\", line 349, in <module>\n main()\n File \"/tmp/ansible_P6vlzq/ansible_module_asa_config.py\", line 341, in main\n run(module, result)\n File \"/tmp/ansible_P6vlzq/ansible_module_asa_config.py\", line 271, in run\n config = get_config(module)\n File \"/tmp/ansible_P6vlzq/ansible_module_asa_config.py\", line 251, in get_config\n contents = module.config.get_config(include=include)\n File \"/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/network.py\", line 98, in get_config\n File \"/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/asa.py\", line 107, in get_config\n File \"/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/shell.py\", line 284, in <lambda>\n File \"/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/shell.py\", line 274, in execute\n File \"/tmp/ansible_P6vlzq/ansible_modlib.zip/ansible/module_utils/shell.py\", line 263, in to_command\nTypeError: __init__() takes exactly 3 arguments (2 given)\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0 } to retry, use: --limit @/work/fwshowver.retry PLAY RECAP ********************************************************************************************************************************** 10.0.203.251 : ok=1 changed=0 unreachable=0 failed=1 [root@1be66e998fd3 work]# -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to ansible-project+unsubscr...@googlegroups.com. To post to this group, send email to ansible-project@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/731d6503-b380-46dd-b826-54bd0e616516%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.