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
configurerole. Persistent PoE configuration (the ping watchdog, priority, voltage, LLDP, and the global power budget) stays inconfigure; this role performs the one-shot actions that have no steady state to reconcile.
Parameters
Parameter |
Comments |
|---|---|
API hostname/IP of the device. Default: |
|
API password. Secret — supply via vault. |
|
TCP port; empty lets the module choose from tls. Default: |
|
Use TLS (api-ssl). Choices:
|
|
API username. Default: |
|
Validate the device TLS certificate. Choices:
|
|
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:
|
|
power_cycle only — how long to drop power (RouterOS duration, 0..1m). Default: |
|
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: |
|
power_on only — the poe-out value to restore. Choices:
|
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 }}"