How to configure prompt with 2 inputs

Hello Gurus

I am working on ios_command module. This modules facilitates in execute commands on Cisco IOS devices.

While running ‘reload’ command it is prompting for 2 inputs,

“System configuration has been modified. Save? [yes/no]” ----> yes
"Proceed with reload? [confirm] ----> return character here

I tried using prompts, but looks like it does not support providing answers for 2 questions in 1 command. Tried expect module (could not get this working)

Any suggestions?

My code snippet:

`
ios_command:
commands:

  • command: ‘reload’
    prompt:
  • “System configuration has been modified. Save? [yes/no]”
  • "Proceed with reload? [confirm]
    answer:
  • “\r”
  • ‘yes’

`

try this?

---
- name: reboot ios device
  cli_command:
    command: reload
    prompt:
      - Save?
      - confirm
    answer:
     - y
     - y

Thanks for our reply Phil. It did not work though.

Any other suggestions ?

I think the only thing missing from @Phil’s answer is check_all: True

Thanks, that helped.