david_igou.routeros_configuration.reboot role – Reboot or shut down a RouterOS device.

Note

This role is part of the david_igou.routeros_configuration collection (version 0.0.8-alpha).

It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it use: ansible-galaxy collection install david_igou.routeros_configuration.

To use it in a playbook, specify: david_igou.routeros_configuration.reboot.

Entry point main – Reboot or shut down a RouterOS device.

Synopsis

  • Reboots and waits for the API, or (gated) shuts the device down.

Parameters

Parameter

Comments

routeros_api_hostname

string

API hostname/IP of the device.

Default: "{{ inventory_hostname }}"

routeros_api_password

string

API password. Secret — supply via vault.

routeros_api_port

any

TCP port; empty lets the module choose from tls.

Default: ""

routeros_api_tls

boolean

Use TLS (api-ssl).

Choices:

  • false

  • true ← (default)

routeros_api_username

string

API username.

Default: "admin"

routeros_api_validate_certs

boolean

Validate the device TLS certificate.

Choices:

  • false

  • true ← (default)

routeros_reboot

boolean

Reboot the device and wait for the API to return.

Choices:

  • false

  • true ← (default)

routeros_reboot_timeout

integer

Seconds to wait for the API after the reboot.

Default: 300

routeros_shutdown

boolean

Shut down the device instead (gated; no reconnect wait).

Choices:

  • false ← (default)

  • true

Examples

# Reboot and wait for the API to return (the default).
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.reboot

# Reboot with a longer reconnect wait for a slow device.
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.reboot
      vars:
        routeros_reboot_timeout: 600

# Shut the device down instead of rebooting (no reconnect wait; gated).
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.reboot
      vars:
        routeros_reboot: false
        routeros_shutdown: true