david_igou.routeros_configuration.poe role – Imperative PoE-out operations on 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.poe.

Entry point main – Imperative PoE-out operations on a RouterOS device.

Synopsis

  • Power-cycle, force off/on, or monitor PoE-out interfaces over the binary API.

  • The operational counterpart to the configure role. Persistent PoE configuration (the ping watchdog, priority, voltage, LLDP, and the global power budget) stays in configure; this role performs the one-shot actions that have no steady state to reconcile.

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_poe_action

string

The PoE-out action. monitor reads live status (read-only); power_cycle drops then restores power; power_off sets poe-out=off; power_on restores poe-out to routeros_poe_mode.

Choices:

  • "monitor" ← (default)

  • "power_cycle"

  • "power_off"

  • "power_on"

routeros_poe_duration

string

power_cycle only — how long to drop power (RouterOS duration, 0..1m).

Default: "5s"

routeros_poe_interfaces

list / elements=string

Target PoE-out interfaces by ethernet interface name. Required (non-empty) for power_cycle/power_off/power_on; an empty list with monitor reads all PoE-out ports.

Default: []

routeros_poe_mode

string

power_on only — the poe-out value to restore.

Choices:

  • "auto-on" ← (default)

  • "forced-on"

  • "forced-on-a"

  • "forced-on-bt"

Examples

# Read-only: monitor every PoE-out port (the default action).
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.poe

# Power-cycle two ports for 10 seconds.
- hosts: routers
  gather_facts: false
  roles:
    - role: david_igou.routeros_configuration.poe
      vars:
        routeros_poe_action: power_cycle
        routeros_poe_duration: 10s
        routeros_poe_interfaces:
          - ether5
          - ether6

# Per-host model: each powered device carries its switch + port as hostvars.
- hosts: poe_powered_devices
  gather_facts: false
  tasks:
    - name: Cut power to this device's port
      ansible.builtin.include_role:
        name: david_igou.routeros_configuration.poe
      vars:
        routeros_api_hostname: "{{ poe_switch }}"
        routeros_poe_action: power_off
        routeros_poe_interfaces:
          - "{{ poe_port }}"