Open SanBern opened 2 years ago
@SanBern did you find a solution to this?
Any progress on this ? I am hitting the same issue.
Given that wen you enter the macro enter mode the prompt is not the standard config one this is probably where this fails.
Might even need a new module to deal with this like the ios_banner module as that deals with a similar situation.
Unfortunately no, I still push the macros separately with the python script.
SUMMARY
We are facing an issue while deploying auto smartports macros. In our environment the whole configuration is normally pushed via Ansible and netconf. since I haven't found a way to deploy the macros with netconf yet, I switched to network_cli and ios_config in ansible.
And here we facing a Problem the macro is generated by a jinja2 template and looks like this:
macro auto execute ADSL-Green { if [[ $LINKUP == YES ]] then conf t interface $INTERFACE Description $TRIGGER macro description $TRIGGER switchport access vlan 100 authentication event server dead action authorize vlan 100 authentication event no-response action authorize vlan 100 exit fi if [[ $LINKUP == NO ]] then conf t interface $INTERFACE no macro description $TRIGGER description dot1x-$TRIGGER-last-used exit fi } ....
ISSUE TYPE
COMPONENT NAME
ios_config
ANSIBLE VERSION
IOS
16.12r up to 16.12.04 17.03.05
STEPS TO REPRODUCE
ACTUAL RESULTS
i have written a script in python to debug with netmiko:
it looks like ansible doesn't understand the macro prompt {..} > and then falls into a timeout
Workaround
in order to push the macro nevertheless, I am currently using a python script with netmiko in which I set cmd_verify=flase in the send config.
output = net_connect.send_config_set(lines,cmd_verify=False)