ansible.builtin.apt_rpm (v2.9.27) — module

apt_rpm package manager

| "added in version" 1.5 of ansible.builtin"

Authors: Evgenii Terechkov (@evgkrsk)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

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: 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

    
pkg:
    description:
    - name of package to install, upgrade or remove.
    required: true

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

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