You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When executing a command that triggers a broadcast message on Cisco IOS devices, the cli_command module will sometimes fail with a timeout. An example of a command that does this is: reload in 5. When executed on a Cisco IOS device, that command will trigger a broadcast message to be issued, eg:
labsw1#reload in 5
Reload scheduled in 5 minutes by ptoal on vty0 (192.168.1.121)
Proceed with reload? [confirm]y
labsw1#
***
*** --- SHUTDOWN in 0:05:00 ---
***
Using the playbook snippet below, it is possible to trigger a timeout every time. By using ansible_buffer_read_timeout: 2, we wait for the broadcast message. Without this setting, the command will succeed or fail somewhat randomly, based on whether or not the broadcast message is received by the module in time.
Hey @ptoal that is expected as it is unable to identify the required prompt, we can definitely update the terminal_stdout_re to accept the broadcast pattern, but we need to be sure if all the broadcast patterns from the iosxe cli are of the same pattern or it would give us false positives.
Regards.
SUMMARY
When executing a command that triggers a broadcast message on Cisco IOS devices, the cli_command module will sometimes fail with a timeout. An example of a command that does this is:
reload in 5
. When executed on a Cisco IOS device, that command will trigger a broadcast message to be issued, eg:ISSUE TYPE
COMPONENT NAME
ansible.netcommon.cli_command
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Cisco C3560E / IOS: Version 15.0(2)SE11
STEPS TO REPRODUCE
Using the playbook snippet below, it is possible to trigger a timeout every time. By using
ansible_buffer_read_timeout: 2
, we wait for the broadcast message. Without this setting, the command will succeed or fail somewhat randomly, based on whether or not the broadcast message is received by the module in time.EXPECTED RESULTS
A broadcast message by the system should be ignored while processing commands and output, to ensure reliable execution.
ACTUAL RESULTS
When executed, the playbook will fail due to a timeout. I believe this is happening because the module is being confused by the broadcast message.
When the module fails, the output from the ansible_log looks like this:
A successful command (no timeout) does not have
response-8
in the output.The text was updated successfully, but these errors were encountered: