You can use cli_command module available in Ansible 2.7 version onwards

https://docs.ansible.com/ansible/latest/modules/cli_command_module.html

The task can be modified as below to support multiple prompts.

- name: Respond to double-password prompt
  cli_command:
    commands:
      - command: crypto pki server my-ca start

        check_all: True
        prompt: 

         - "password"

         - "enter password"

        answer: 

          - "mypassword\r"

          - "mypassword\r"




On Monday, 11 March 2019 10:13:06 UTC+5:30, ibdg wrote:
>
> Just noticed, my title here is wrong, it should be 'ios_command' not 
> 'ios_config'
>

-- 
You received this message because you are subscribed to the Google Groups 
"Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/b7880b8c-3104-4207-af39-8e3ea803fb17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to