Description
SUMMARY
Maybe I don’t understand correctly, so can you please let me know?
In the document is written the following like.
In the following example, the second answer would be ignored and y would be the answer given to both prompts.
In my perception, the first answer should be used even in the second prompt when check_all is false.
I tried that but the first answer wasn't used and a timeout occurs.
ISSUE TYPE
- Bug Report
COMPONENT NAME
plugins/connection/network_cli.py
ANSIBLE VERSION
$ ansible --version
ansible 2.10.1
CONFIGURATION
$ ansible-config dump --only-changed
HOST_KEY_CHECKING(/path/ansible.cfg) = False
OS / ENVIRONMENT
Cisco csr1000
STEPS TO REPRODUCE
pre condition in csr1000
I set that the following was displayed to prompt when executing reload command.
- System configuration has been modified. Save? [yes/no]:
- Proceed with reload? [confirm]
After completing the above work, I created the following playbook and execute it.
---
- name: Test Playbook
hosts: cisco1
gather_facts: false
become: true
tasks:
- name: Execute command
cli_command:
command: reload
prompt:
- 'System configuration has been modified'
- 'confirm'
answer:
- 'yes'
- 'yes'
EXPECTED RESULTS
The first answer also used in the second prompt and reboot OS.
ACTUAL RESULTS
The first answer doesn't use in the second prompt and the time-out error occurs.
fatal: [ping]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "timeout value 30 seconds reached while trying to send command: b'reload'"}
As far as I'm looking at the following codes, I seem that the first answer is ignored in the second prompt if check_all is false.
ansible.netcommon/plugins/connection/network_cli.py
Lines 923 to 978 in 3aca2f0
ansible.netcommon/plugins/connection/network_cli.py
Lines 654 to 723 in 3aca2f0
Is this correct behavior?