cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
259
Views
0
Helpful
1
Replies

how to deal with prompts when using ios_config ansible module

pcook10
Level 1
Level 1

Trying to use ios_config module, with 'src' parameter pointing to a set of dynamically generated lines of configuration. We put these all together and send it to a final module which uses ios_config to try and configure the device. For one such scenario on one platform, i'm getting following prompt which is causing the workflow to time out;
Static entry in use, do you want to delete child entries? [no]:
(adding a clear ip nat trans forced command before the remove command doesn't clear the prompt appearing)
From what i can see, there doesn't seem to be a way to handle prompts within the ios_config module, and the other suggestions ive come across, which are to use cli_command or ios_command modules don't seem to allow me to specify a 'src' file, instead require the commands to be defined within the task. Is there a workaround? 




1 Reply 1

@pcook10 so what you are seeing is kinda of expected, ios_config module in ansible is designed for bulk configuration changes but lacks built-in prompt handling sadly. Check out https://docs.ansible.com/ansible/latest/collections/ansible/netcommon/cli_command_module.html he module is your best bet for interacting with prompts as you can use a loop to feed it commands from your dynamically generated configuration file.

 
Hope this helps.
Please mark this as helpful or solution accepted to help others
Connect with me https://bigevilbeard.github.io