community.general.apt_rpm (0.2.1) — module

apt_rpm package manager

Authors: Evgenii Terechkov (@evgkrsk)

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

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
  apt_rpm:
    pkg: foo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install packages foo and bar
  apt_rpm:
    pkg:
      - foo
      - bar
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove package foo
  apt_rpm:
    pkg: foo
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove packages foo and bar
  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
  apt_rpm:
    name: bar
    state: present
    update_cache: yes

Inputs

    
state:
    choices:
    - absent
    - present
    default: present
    description:
    - Indicates the desired package state.

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

update_cache:
    default: 'no'
    description:
    - update the package database first C(apt-get update).
    type: bool