community.general.xbps – Manage packages with XBPS

Note

This plugin is part of the community.general collection (version 3.6.0).

To install it use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.xbps.

Synopsis

  • Manage packages with the XBPS package manager.

Parameters

Parameter Choices/Defaults Comments
name
list / elements=string
Name of the package to install, upgrade, or remove.

aliases: pkg, package
recurse
boolean
    Choices:
  • no ←
  • yes
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.
state
string
    Choices:
  • present ←
  • absent
  • latest
  • installed
  • removed
Desired state of the package.
update_cache
boolean
    Choices:
  • no
  • yes ←
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 update-cache has been deprecated and will be removed in community.general 5.0.0.

aliases: update-cache
upgrade
boolean
    Choices:
  • no ←
  • yes
Whether or not to upgrade whole system
upgrade_xbps
boolean
added in 0.2.0 of community.general
    Choices:
  • no
  • yes ←
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 no, upgrades and installations will fail when xbps is not up to date.

Examples

- name: Install package foo (automatically updating the xbps package if needed)
  community.general.xbps: name=foo state=present

- name: Upgrade package foo
  community.general.xbps: name=foo state=latest update_cache=yes

- name: Remove packages foo and bar
  community.general.xbps: name=foo,bar state=absent

- name: Recursively remove package foo
  community.general.xbps: name=foo state=absent recurse=yes

- name: Update package cache
  community.general.xbps: update_cache=yes

- name: Upgrade packages
  community.general.xbps: upgrade=yes

- name: Install a package, failing if the xbps package is out of date
  community.general.xbps:
    name: foo
    state: present
    upgrade_xbps: no

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
msg
string
success
Message about results

Sample:
System Upgraded
packages
list / elements=string
success
Packages that are affected/would be affected

Sample:
['ansible']


Authors

  • Dino Occhialini (@dinoocch)

  • Michael Aldridge (@the-maldridge)