1

I have a task that reloads a number of Cisco Routers and Cisco Firewalls. For some reason the playbook always hangs at this task after the playbook have already reloaded the first device. The reload command is actually sent to the second device and I can see the device restart but the task will eventually fail.

Output:

Task [Reload Host Device]
fatal: [firewall2]: FAILED! => {"changed: false, "msg": "command timeout triggered, timeout value is 30 secs. \nsee the timeout setting options in the Network Debug and Troubleshooting Guide."} ...ignoring

Task:

- name: Reload Host Device 
  cli_command:
    command: "reload"
    prompt:
      - "Proceed with reload?"
    answer:
      - "y"
  ignore_errors: yes
U880D
  • 8,601
  • 6
  • 24
  • 40
uncowandy
  • 59
  • 3

1 Answers1

1

According the given description, task and error message

command timeout triggered ... see the timeout setting options in the Network Debug and Troubleshooting Guide.

the devices which Ansible are connects to are going to restart faster than Ansible and the module cli_command can maintain his own connection. Meaning, close and disconnect the session.

According the Command Reference and Cisco Router: Auto restart in x seconds you may try with

- name: Schedule Host Device Reload in 1 min
  cli_command:
    command: "reload in 1"
    prompt:
      - "Proceed with reload?"
    answer:
      - "y"
  register: result

- name: Show result
  debug:
    var: result

Further Reading

An other approach which was used in the past for Linux systems

U880D
  • 8,601
  • 6
  • 24
  • 40
  • 1
    Thank you! This make total sense. I made the update and I'm not seeing any errors within the ansible console output. – uncowandy Jan 12 '23 at 17:49
  • So the first time executing the playbook after the update, I didn't see any errors as I stated earlier. However, running the tasks ever since still result into a failure for this task (the command is still being sent to the device however) – uncowandy Jan 12 '23 at 18:46