community.general.urpmi module – Urpmi manager

Note

This module is part of the community.general collection (version 8.6.7).

You might already have this collection installed if you are using the ansible package. 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.general.

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

Synopsis

  • Manages packages with urpmi (such as for Mageia or Mandriva)

Aliases: packaging.os.urpmi

Parameters

Parameter

Comments

force

boolean

Assume “yes” is the answer to any question urpmi has to ask. Corresponds to the --force option for urpmi.

Choices:

  • false

  • true ← (default)

name

aliases: package, pkg

list / elements=string / required

A list of package names to install, upgrade or remove.

no_recommends

boolean

Corresponds to the --no-recommends option for urpmi.

Choices:

  • false

  • true ← (default)

root

aliases: installroot

string

Specifies an alternative install root, relative to which all packages will be installed. Corresponds to the --root option for urpmi.

state

string

Indicates the desired package state.

Choices:

  • "absent"

  • "present" ← (default)

  • "installed"

  • "removed"

update_cache

boolean

Update the package database first urpmi.update -a.

Choices:

  • false ← (default)

  • true

Attributes

Attribute

Support

Description

check_mode

Support: none

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Install package foo
  community.general.urpmi:
    pkg: foo
    state: present

- name: Remove package foo
  community.general.urpmi:
    pkg: foo
    state: absent

- name: Remove packages foo and bar
  community.general.urpmi:
    pkg: foo,bar
    state: absent

- name: Update the package database (urpmi.update -a -q) and install bar (bar will be the updated if a newer version exists)
- community.general.urpmi:
    name: bar
    state: present
    update_cache: true

Authors

  • Philippe Makowski (@pmakowski)