ansible.builtin.apk (v2.3.0.0-1) — module

Manages apk packages

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

Authors: Kevin Brebanov (@kbrebanov)

stableinterface | supported by community

Install Ansible via pip

Install with pip install ansible==2.3.0.0.post1

Description

Manages I(apk) packages for Alpine Linux.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update repositories and install "foo" package
- apk:
    name: foo
    update_cache: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update repositories and install "foo" and "bar" packages
- apk:
    name: foo,bar
    update_cache: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove "foo" package
- apk:
    name: foo
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Remove "foo" and "bar" packages
- apk:
    name: foo,bar
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Install the package "foo"
- apk:
    name: foo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Install the packages "foo" and "bar"
- apk:
    name: foo,bar
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update repositories and update package "foo" to latest version
- apk:
    name: foo
    state: latest
    update_cache: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update repositories and update packages "foo" and "bar" to latest versions
- apk:
    name: foo,bar
    state: latest
    update_cache: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update all installed packages to the latest versions
- apk:
    upgrade: yes
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Update repositories as a separate step
- apk:
    update_cache: yes

Inputs

    
name:
    default: null
    description:
    - A package name, like C(foo), or mutliple packages, like C(foo, bar).
    required: false

state:
    choices:
    - present
    - absent
    - latest
    default: present
    description:
    - Indicates the desired package(s) state.
    - C(present) ensures the package(s) is/are present.
    - C(absent) ensures the package(s) is/are absent.
    - C(latest) ensures the package(s) is/are present and the latest version(s).
    required: false

upgrade:
    choices:
    - 'yes'
    - 'no'
    default: false
    description:
    - Upgrade all installed packages to their latest version.
    required: false

update_cache:
    choices:
    - 'yes'
    - 'no'
    default: false
    description:
    - Update repository indexes. Can be run with other steps or on it's own.
    required: false