Handling Prompt in Cisco IOS_CONFIG module

Hello All - Using Ansible v2.7
I am tying to execute Cisco IOS commands that prompts to type Y/N. Looks like the Prompt: is not available in ios_config module. For example

  • name: delete_crypto_map
    ios_config:
    lines:
  • no crypto pki trustpoint CTA
  • yes
    The above script doesnt work as the logs shows connection error: timeout value 10 seconds reached while trying to send command
    Looks like the after executing the command no crypto pki trustpoint CTA the Y/N is prompted by the ansible is not sending Y to the prompt

The prompt: works for ios_commands: module but doesnt work on ios_config:

Do you have any experience on this kind of requirement or thoughts please?

Can anybody have requirement similar to this? I tried with cli_command, ios_command too…

I got the answer from another forum. It is just a workaround only using cli_command module

I read ansible 2.7 dont support prompt in ios_config.
We need to user ios_command with loop as below

  • name: delete_crypto_map
    cli_command:
    command: “{{ item }}”
    prompt:
  • “Are you sure you want to do this”
    answer: ‘yes’
    loop:
  • config t
  • no crypto pki trustpoint CTA

Yes, ios_config does not support prompting, Can you disable prompting and re-enable once a task is done?