community.general.xbps (0.2.1) — module

Manage packages with XBPS

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

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 0.2.1

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)
  xbps: name=foo state=present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade package foo
  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
  xbps: name=foo,bar state=absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Recursively remove package foo
  xbps: name=foo state=absent recurse=yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update package cache
  xbps: update_cache=yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade packages
  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
  xbps:
    name: foo
    state: present
    upgrade_xbps: no

Inputs

    
name:
    description:
    - Name of the package to install, upgrade, or remove.

state:
    choices:
    - present
    - absent
    - latest
    default: present
    description:
    - Desired state of the package.

recurse:
    default: 'no'
    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: 'no'
    description:
    - Whether or not to upgrade whole system
    type: bool

update_cache:
    default: 'yes'
    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.
    type: bool

upgrade_xbps:
    default: 'yes'
    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