community.openwrt.setup module – Gather facts about OpenWrt systems
Note
This module is part of the community.openwrt collection (version 1.1.0).
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 community.openwrt.
To use it in a playbook, specify: community.openwrt.setup.
Synopsis
The community.openwrt.setup module gathers facts about OpenWrt systems.
It collects system information including distribution details, hostname, network interfaces, services, and device information through ubus.
This module is automatically called by playbooks to gather useful variables about remote hosts.
Note
This module has a corresponding action plugin.
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full This action does not modify state. |
Can run in |
|
Support: N/A This action does not modify state. |
Returns details on what has changed (or possibly needs changing in |
|
Support: full |
Action returns an |
|
Platform: OpenWrt |
Target platform for this module. |
Notes
Note
This module gathers OpenWrt-specific facts including
ubusdata for network interfaces, devices, services, and system information.Facts are returned in the
ansible_factsnamespace.
Examples
- name: Gather facts from OpenWrt device
community.openwrt.setup:
- name: Show distribution version
ansible.builtin.debug:
msg: "{{ ansible_distribution_version }}"
Returned Facts
Facts returned by this module are added/updated in the hostvars host facts and can be referenced by name just like any other host fact. They do not need to be registered in order to use them.
Key |
Description |
|---|---|
The distribution name. Returned: success Sample: |
|
The major version of the distribution. Returned: success Sample: |
|
The distribution release codename. Returned: success Sample: |
|
The distribution version. Returned: success Sample: |
|
The hostname of the system. Returned: success Sample: |
|
Whether the system is running in a chroot. Returned: success Sample: |
|
The OS family. Returned: success Sample: |
|
Board information from Returned: when available |
|
Network device status from Returned: when available |
|
System information from Returned: when available |
|
Network interface status from Returned: when available |
|
Service list from Returned: when available |
|
Wireless status from Returned: when available |