community.general.apt_rpm (2.5.9) — module

apt_rpm package manager

Authors: Evgenii Terechkov (@evgkrsk)

Install collection

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


Add to requirements.yml

  collections:
    - name: community.general
      version: 2.5.9

Description

Manages packages with I(apt-rpm). Both low-level (I(rpm)) and high-level (I(apt-get)) package manager binaries required.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install package foo
  community.general.apt_rpm:
    pkg: foo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install packages foo and bar
  community.general.apt_rpm:
    pkg:
      - foo
      - bar
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove package foo
  community.general.apt_rpm:
    pkg: foo
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove packages foo and bar
  community.general.apt_rpm:
    pkg: foo,bar
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# bar will be the updated if a newer version exists
- name: Update the package database and install bar
  community.general.apt_rpm:
    name: bar
    state: present
    update_cache: yes

Inputs

    
state:
    choices:
    - absent
    - present
    - installed
    - removed
    default: present
    description:
    - Indicates the desired package state.
    type: str

package:
    aliases:
    - name
    - pkg
    description:
    - list of packages to install, upgrade or remove.
    elements: str
    required: true
    type: list

update_cache:
    aliases:
    - update-cache
    default: false
    description:
    - update the package database first C(apt-get update).
    - Alias C(update-cache) has been deprecated and will be removed in community.general
      5.0.0.
    type: bool