community.general.xbps (3.8.10) — module

Manage packages with XBPS

Authors: Dino Occhialini (@dinoocch), Michael Aldridge (@the-maldridge)

Install collection

Install with ansible-galaxy collection install community.general:==3.8.10


Add to requirements.yml

  collections:
    - name: community.general
      version: 3.8.10

Description

Manage packages with the XBPS package manager.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install package foo (automatically updating the xbps package if needed)
  community.general.xbps: name=foo state=present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade package foo
  community.general.xbps: name=foo state=latest update_cache=yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove packages foo and bar
  community.general.xbps: name=foo,bar state=absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Recursively remove package foo
  community.general.xbps: name=foo state=absent recurse=yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update package cache
  community.general.xbps: update_cache=yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade packages
  community.general.xbps: upgrade=yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install a package, failing if the xbps package is out of date
  community.general.xbps:
    name: foo
    state: present
    upgrade_xbps: no

Inputs

    
name:
    aliases:
    - pkg
    - package
    description:
    - Name of the package to install, upgrade, or remove.
    elements: str
    type: list

state:
    choices:
    - present
    - absent
    - latest
    - installed
    - removed
    default: present
    description:
    - Desired state of the package.
    type: str

recurse:
    default: false
    description:
    - When removing a package, also remove its dependencies, provided that they are not
      required by other packages and were not explicitly installed by a user.
    type: bool

upgrade:
    default: false
    description:
    - Whether or not to upgrade whole system
    type: bool

update_cache:
    aliases:
    - update-cache
    default: true
    description:
    - Whether or not to refresh the master package lists. This can be run as part of a
      package installation or as a separate step.
    - Alias C(update-cache) has been deprecated and will be removed in community.general
      5.0.0.
    type: bool

upgrade_xbps:
    default: true
    description:
    - Whether or not to upgrade the xbps package when necessary. Before installing new
      packages, xbps requires the user to update the xbps package itself. Thus when this
      option is set to C(no), upgrades and installations will fail when xbps is not up
      to date.
    type: bool
    version_added: 0.2.0
    version_added_collection: community.general

Outputs

msg:
  description: Message about results
  returned: success
  sample: System Upgraded
  type: str
packages:
  description: Packages that are affected/would be affected
  returned: success
  sample:
  - ansible
  type: list