david_igou.routeros_configuration.upgrade role – Manage RouterOS package updates over the API.

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.upgrade.

Entry point main – Manage RouterOS package updates over the API.

Synopsis

  • Sets the package update channel (idempotently) and checks for updates.

  • Optionally installs an available update, which reboots the device — gated behind routeros_upgrade_install and only when an update is available.

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. The module marks it no_log.

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_routerboard_upgrade

boolean

Upgrade RouterBOARD firmware and reboot. Gated; not applicable to CHR.

Choices:

  • false ← (default)

  • true

routeros_update_channel

string

RouterOS package update channel.

Choices:

  • "stable" ← (default)

  • "testing"

  • "long-term"

  • "development"

routeros_upgrade_install

boolean

Install an available update. REBOOTS the device.

Choices:

  • false ← (default)

  • true

routeros_upgrade_reboot_timeout

integer

Seconds to wait for the API to return after an install/reboot.

Default: 300

Examples

# Set the update channel only (install gated off by default; never reboots).
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.upgrade
      vars:
        routeros_update_channel: long-term

# Install an available update (REBOOTS the device; waits for the API).
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.upgrade
      vars:
        routeros_update_channel: stable
        routeros_upgrade_install: true
        routeros_upgrade_reboot_timeout: 600

# Upgrade RouterBOARD bootloader firmware and reboot (gated; not on a CHR).
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.upgrade
      vars:
        routeros_routerboard_upgrade: true