community / community.general / 6.6.8 / module / apt_rpm APT-RPM package manager Authors: Evgenii Terechkov (@evgkrsk)community.general.apt_rpm (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
Manages packages with I(apt-rpm). Both low-level (I(rpm)) and high-level (I(apt-get)) package manager binaries required.
- 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
clean: default: false description: - Run the equivalent of C(apt-get clean) to clear out the local repository of retrieved package files. It removes everything but the lock file from C(/var/cache/apt/archives/) and C(/var/cache/apt/archives/partial/). - Can be run as part of the package installation (clean runs before install) or as a separate step. type: bool version_added: 6.5.0 version_added_collection: community.general 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 type: list dist_upgrade: default: false description: - If true performs an C(apt-get dist-upgrade) to upgrade system. type: bool version_added: 6.5.0 version_added_collection: community.general update_cache: default: false description: - Run the equivalent of C(apt-get update) before the operation. Can be run as part of the package installation or as a separate step. - Default is not to update the cache. type: bool update_kernel: default: false description: - If true performs an C(update-kernel) to upgrade kernel packages. type: bool version_added: 6.5.0 version_added_collection: community.general