# Problems with asa\_config

**URL:** <https://forum.ansible.com/t/problems-with-asa-config/22597>\
**Category:** Ansible Project\
**Created:** [September 20, 2016, 5:22pm UTC](https://forum.ansible.com/t/problems-with-asa-config/22597 "2016-09-20T17:22:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Steven\_Carter](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@Steven\_Carter](https://forum.ansible.com/u/Steven_Carter)\
**Post date:** [September 20, 2016, 5:22pm UTC](https://forum.ansible.com/t/problems-with-asa-config/22597/1 "2016-09-20T17:22:56Z")

</div>

I am having problems running the following play:

- hosts: cil-fw  
gather\_facts: no  
connection: local  
vars\_files:
- ./cilfu-vars.yml
- ./cil-vault.yml  
vars:  
cli:  
host: “{{ inventory\_hostname }}”  
username: “{{ cil\_admin\_username }}”  
password: “{{ cil\_admin\_password }}”  
transport: cli

tasks:

- name: Get Version  
asa\_command:  
commands:

- show version  
provider: “{{ cli }}”

- name: Add Context  
asa\_config:  
lines:

- context cilfu

- allocate-interface Port-channel1.102

- allocate-interface Port-channel1.703

- config-url disk0:/cilfu.cfg  
context: system  
provider: “{{ cli }}”

- name: Configure the outside interface  
asa\_config:  
lines:

- nameif outside  
context: cilfu  
parents: [‘interface Port-channel1.102’]  
provider: “{{ cli }}”

The first problem was with authentication. Originally, I had “authorize” and “auth\_pass” set, but it did not seem to be able to enable properly:

TASK [Add Context] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [csn-sjc18-asa1]: FAILED! =\> {“changed”: false, “failed”: true, “msg”: "matched error in response: changeto system\r\n^\r\nERROR: % Invalid input detected at ‘^’ marker.\r\n\rcsn-sjc18-asa1/admin\> "}

I got around this problem by giving the admin user auto-exec. The next play seems to run:

PLAY [cil-fw] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [Get Version] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
ok: [csn-sjc18-asa1]

TASK [Add Context] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
changed: [csn-sjc18-asa1]

TASK [Configure the outside interface] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
fatal: [csn-sjc18-asa1]: FAILED! =\> {“changed”: false, “commands”: [“configure terminal”, “interface Port-channel1.102”, “nameif outside”, “end”], “failed”: true, “msg”: "matched error in response: bal\r\nCryptochecksum:45e26010ee904847ecd150979e737e47\r\n: end\r\n\rcsn-sjc18-asa1/cilfu# Port-channel1.102\r\n ^\r\nERROR: % Invalid input detected at ‘^’ marker.\r\n\rcsn-sjc18-asa1/cilfu# "}  
to retry, use: --limit @/Users/stevenca/Box Sync/csn/cil/ansible/cilfu-asa.retry

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
csn-sjc18-asa1 : ok=2 changed=1 unreachable=0 failed=1

Task “Add Context” seems to complete, but the context does not show up in the config. When I add it manually and try to configure nameif under the interface, I get the failure that I see above. Is this module still in the works or am I doing something wrong (or both)? In either case, I am happy to do some testing on it.

Thanks,

Steven.
