Reputation: 29
I'm trying to reload a device with ansible ios_command.
The manual reload output is :
router#reload
Reload command is being issued on Active unit, this will reload the whole stack
Proceed with reload? [confirm]
My reload playbook section looks like :
commands:
-command: reload
prompt: 'Proceed with reload? [confirm]'
answer: "\r"
But I can not get it working. How can I specify several lines for prompt parsing?
Upvotes: 1
Views: 2653
Reputation: 1805
Based on akhil01 answer, this worked for me
name: Confirmation Required
pause:
prompt: |
proceed with reload ?
{{ vars_also_works }}
Press ENTER to continue or CTRL+C and A to abort...
Upvotes: 2
Reputation: 11
You can use with_items
, this worked for me.
name: Confirmation Required
pause:
prompt: "{{ item }}"
with_items: |
proceed with reload ?
Press ENTER to continue or CTRL+C and A to abort...
Upvotes: 1