community / community.general / 1.3.14 / module / apk Manages apk packages Authors: Kevin Brebanov (@kbrebanov)community.general.apk (1.3.14) — module
Install with ansible-galaxy collection install community.general:==1.3.14
collections: - name: community.general version: 1.3.14
Manages I(apk) packages for Alpine Linux.
- name: Update repositories and install foo package community.general.apk: name: foo update_cache: yes
- name: Update repositories and install foo and bar packages community.general.apk: name: foo,bar update_cache: yes
- name: Remove foo package community.general.apk: name: foo state: absent
- name: Remove foo and bar packages community.general.apk: name: foo,bar state: absent
- name: Install the package foo community.general.apk: name: foo state: present
- name: Install the packages foo and bar community.general.apk: name: foo,bar state: present
- name: Update repositories and update package foo to latest version community.general.apk: name: foo state: latest update_cache: yes
- name: Update repositories and update packages foo and bar to latest versions community.general.apk: name: foo,bar state: latest update_cache: yes
- name: Update all installed packages to the latest versions community.general.apk: upgrade: yes
- name: Upgrade / replace / downgrade / uninstall all installed packages to the latest versions available community.general.apk: available: yes upgrade: yes
- name: Update repositories as a separate step community.general.apk: update_cache: yes
- name: Install package from a specific repository community.general.apk: name: foo state: latest update_cache: yes repository: http://dl-3.alpinelinux.org/alpine/edge/main
- name: Install package without using cache community.general.apk: name: foo state: latest no_cache: yes
name: description: - A package name, like C(foo), or multiple packages, like C(foo, bar). elements: str type: list state: choices: - present - absent - latest - installed - removed default: present description: - Indicates the desired package(s) state. - C(present) ensures the package(s) is/are present. C(installed) can be used as an alias. - C(absent) ensures the package(s) is/are absent. C(removed) can be used as an alias. - C(latest) ensures the package(s) is/are present and the latest version(s). type: str upgrade: default: false description: - Upgrade all installed packages to their latest version. type: bool no_cache: default: false description: - Do not use any local cache path. type: bool version_added: 1.0.0 version_added_collection: community.general available: default: false description: - During upgrade, reset versioned world dependencies and change logic to prefer replacing or downgrading packages (instead of holding them) if the currently installed package is no longer available from any repository. type: bool repository: description: - A package repository or multiple repositories. Unlike with the underlying apk command, this list will override the system repositories rather than supplement them. elements: str type: list update_cache: default: false description: - Update repository indexes. Can be run with other steps or on it's own. type: bool
packages: description: a list of packages that have been changed returned: when packages have changed sample: - package - other-package type: list