Hi Kai.
Trust you are well, we are testing adding new configs via Ansible on the SBC, just struggling, to handle the various prompt changes, as you navigate the different configuration levels, and I have tweaked the playbook, but not coming right.
Here is the below output.
The full traceback is:
File “/tmp/ansible_expect_payload_zp_yu2yh/ansible_expect_payload.zip/ansible/modules/commands/expect.py”, line 123, in wrapped
fatal: [###########]: FAILED! => {
“changed”: false,
“invocation”: {
“module_args”: {
“chdir”: null,
“command”: “ssh admin@##########”,
“creates”: null,
“echo”: false,
“removes”: null,
“responses”: {
“(?i)password”: “########”,
“(configure)#”: [
“media-manager realm-config”
],
“(realm-config)#”: [
“identifier TEST_REALM_2”,
“addr-prefix 10.1.0.0/29”,
“network-interfaces PEER_F00:0”,
“mm-in-realm disabled”,
“mm-in-network enabled”,
“mm-same-ip disabled”,
“mm-in-system enabled”,
“access-control-trust-level medium”,
“invalid-signal-threshold 1’”,
“maximum-signal-threshold 4000”,
“untrusted-signal-threshold 0”,
“options sip-connect-pbx-reg”,
“qos-enable enabled”,
“accounting-enable enabled”,
“done”,
“quit”
],
“HA1#”: [
“save-config”,
“verify-confog”,
“activate-config”
]
},
“timeout”: 30
}
},
“msg”: “No remaining responses for ‘HA1#’, output was ’ activate-config\r\nActivate-Config received, processing.\r\nwaiting for request to finish\r\nRequest to ‘ACTIVATE-CONFIG’ has Finished, \r\nActivate Complete\r\nLABHA1#'”
}
…ignoring
Here is my playbook:
- name: Add config centrex child realm
hosts: 10.11.171.20
connection: local
gather_facts: yes
tasks:
-
name: Add config
expect:
command: ssh admin@##########
responses:
(?i)password: “##########”
‘HA1#’:
-
conf t
‘(configure)#’:
-
media-manager realm-config
‘(realm-config)#’:
-
identifier TEST_REALM_2
-
addr-prefix 10.1.0.0/29
-
network-interfaces PEER_F00:0
-
mm-in-realm disabled
-
mm-in-network enabled
-
mm-same-ip disabled
-
mm-in-system enabled
-
access-control-trust-level medium
-
invalid-signal-threshold 1’
-
maximum-signal-threshold 4000
-
untrusted-signal-threshold 0
-
options sip-connect-pbx-reg
-
qos-enable enabled
-
accounting-enable enabled
-
done
-
quit
‘HA1#’:
-
save-config
-
verify-confog
-
activate-config
ignore_errors: true
register: labsbc
-
debug: var=labsbc.stdout_lines