community.general.apt_rpm module – APT-RPM package manager
Note
This module is part of the community.general collection (version 7.5.2).
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.apt_rpm
.
Synopsis
Manages packages with
apt-rpm
. Both low-level (rpm
) and high-level (apt-get
) package manager binaries required.
Aliases: packaging.os.apt_rpm
Parameters
Parameter |
Comments |
---|---|
Run the equivalent of Can be run as part of the package installation (clean runs before install) or as a separate step. Choices:
|
|
If true performs an Choices:
|
|
List of packages to install, upgrade, or remove. |
|
Indicates the desired package state. Choices:
|
|
Run the equivalent of Default is not to update the cache. Choices:
|
|
If true performs an Choices:
|
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: none |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Install package foo
community.general.apt_rpm:
pkg: foo
state: present
- name: Install packages foo and bar
community.general.apt_rpm:
pkg:
- foo
- bar
state: present
- name: Remove package foo
community.general.apt_rpm:
pkg: foo
state: absent
- name: Remove packages foo and bar
community.general.apt_rpm:
pkg: foo,bar
state: absent
# 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: true
- name: Run the equivalent of "apt-get clean" as a separate step
community.general.apt_rpm:
clean: true
- name: Perform cache update and complete system upgrade (includes kernel)
community.general.apt_rpm:
update_cache: true
dist_upgrade: true
update_kernel: true