Re: [ansible-project] Re: How to configure prompt with 2 inputs

2020-01-14 Thread Srinivas Naram
Thanks, that helped.

On Mon, Jan 13, 2020 at 9:55 PM Uriel  wrote:

> I think the only thing missing from @Phil's answer is check_all: True
>
> On Monday, January 13, 2020 at 2:51:48 AM UTC-6, Srinivas Naram wrote:
>>
>> Thanks for our reply Phil. It did not work though.
>>
>> Any other suggestions ?
>>
>> On Fri, Jan 10, 2020 at 10:25 PM Phil Griffiths 
>> wrote:
>>
>>> try this?
>>>
>>>  name: reboot ios device
>>>   cli_command:
>>> command: reload
>>> prompt:
>>>   - Save?
>>>   - confirm
>>> answer:
>>>  - y
>>>  - y
>>>
>>>
>>>
>>> On Friday, 10 January 2020 14:28:23 UTC, Srinivas Naram wrote:

 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'




 --
>>> 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 ansible...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/ansible-project/5f7e1ebb-3cd3-4fa4-9d15-7814a9597e23%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/58df3013-6a9a-4aff-8ff2-233d0fcca48b%40googlegroups.com
> 
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG-N3P6nA0PFeAUQSo1w3GiD6gTz30sAh8eRFE3e%2BF7qVEKZZg%40mail.gmail.com.


Re: [ansible-project] Re: How to configure prompt with 2 inputs

2020-01-13 Thread Uriel
I think the only thing missing from @Phil's answer is check_all: True

On Monday, January 13, 2020 at 2:51:48 AM UTC-6, Srinivas Naram wrote:
>
> Thanks for our reply Phil. It did not work though.
>
> Any other suggestions ?
>
> On Fri, Jan 10, 2020 at 10:25 PM Phil Griffiths  > wrote:
>
>> try this?
>>
>>  name: reboot ios device
>>   cli_command:
>> command: reload
>> prompt:
>>   - Save?
>>   - confirm
>> answer:
>>  - y
>>  - y
>>
>>
>>
>> On Friday, 10 January 2020 14:28:23 UTC, Srinivas Naram wrote:
>>>
>>> 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'
>>>
>>>
>>>   
>>>
>>> -- 
>> 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 ansible...@googlegroups.com .
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/ansible-project/5f7e1ebb-3cd3-4fa4-9d15-7814a9597e23%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/58df3013-6a9a-4aff-8ff2-233d0fcca48b%40googlegroups.com.


Re: [ansible-project] Re: How to configure prompt with 2 inputs

2020-01-13 Thread Srinivas Naram
Thanks for our reply Phil. It did not work though.

Any other suggestions ?

On Fri, Jan 10, 2020 at 10:25 PM Phil Griffiths 
wrote:

> try this?
>
>  name: reboot ios device
>   cli_command:
> command: reload
> prompt:
>   - Save?
>   - confirm
> answer:
>  - y
>  - y
>
>
>
> On Friday, 10 January 2020 14:28:23 UTC, Srinivas Naram wrote:
>>
>> 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'
>>
>>
>>
>>
>> --
> 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 ansible-project+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/ansible-project/5f7e1ebb-3cd3-4fa4-9d15-7814a9597e23%40googlegroups.com
> 
> .
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/CAG-N3P6a6Jee-mTLCAa5e1kf7torPhO%2BU4ucFkoPvg3cZ6SKqA%40mail.gmail.com.


[ansible-project] Re: How to configure prompt with 2 inputs

2020-01-10 Thread Phil Griffiths
try this?

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



On Friday, 10 January 2020 14:28:23 UTC, Srinivas Naram wrote:
>
> 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'
>
>
>   
>
>

-- 
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 ansible-project+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/ansible-project/5f7e1ebb-3cd3-4fa4-9d15-7814a9597e23%40googlegroups.com.