Skip to content

Report of installed packages aka package_facts #142

@sguarin

Description

@sguarin
SUMMARY

There is a standard module which is typically run after setup (when needed), it is called ansible.builtin.package_facts.
It provides a json listing of the installed packages depending on the package management engine.
Example:

ok: [bpir4.lan] => {
    "ansible_facts['packages']": {
        "apk-mbedtls": [
            {
                "name": "apk-mbedtls",
                "release": "r2",
                "source": "apk",
                "version": "3.0.2"
            }
        ],
        "base": [
            {
                "name": "base",
                "release": "1683~e94d4f2022",
                "source": "apk",
                "version": "files"
            }
        ],
...

I would like to have a lightweigh version of community.openwrt.package_facts that will do the same thing based on apk or opkg package management (without having python3 installed).

ISSUE TYPE
  • Feature Idea
COMPONENT NAME

Implement new module:

community.openwrt.package_facts

That will provide the json listing based on the package managment detected.

ADDITIONAL INFORMATION

Example of usage:

...
    - name: Retrieve packages installed (openwrt)
      community.openwrt.package_facts:

    - name: Builtin package_facts
      ansible.builtin.debug:
        var: ansible_facts['packages']
...

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions