community.openwrt.package_facts module – Gather package facts in OpenWrt systems
Note
This module is part of the community.openwrt collection (version 1.2.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.package_facts.
New in community.openwrt 1.1.0
Synopsis
The community.openwrt.package_facts module gathers facts about installed packages in OpenWrt systems.
It collects package name, version and package version of every installed package.
This module should be called manually by playbooks when needed. It’s not part of the
setuptask.
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
Facts are returned in the
ansible_factsnamespace (packageskey).
Examples
- name: Gather facts from OpenWrt device
community.openwrt.package_facts:
- name: Show installed packages
ansible.builtin.debug:
msg: "{{ ansible_facts['packages'] }}"
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 |
|---|---|
Maps the package name to a non-empty list of dicts with package information. Every dict in the list corresponds to one installed version of the package. The fields described below are present for the package manager detected ( Returned: when operating system level package manager is auto detected succesfully. Sample: |
|
The package name. Returned: success Sample: |
|
The release version of the package. Returned: success Sample: |
|
The package management detected. Returned: success Sample: |
|
The version of the software. Returned: success Sample: |