community.openwrt.apk module – Manage packages with apk on OpenWrt
Note
This module is part of the community.openwrt collection (version 0.5.0).
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.openwrt.
To use it in a playbook, specify: community.openwrt.apk.
New in community.openwrt 0.4.0
Synopsis
The community.openwrt.apk module manages packages on OpenWrt using the apk package manager (available in OpenWrt 25.12+).
It can install and remove packages.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
|---|---|
Continue even if package dependencies are broken. Choices:
|
|
Name of the package(s) to install or remove. Multiple packages can be specified as a comma-separated list with no spaces, for example |
|
Do not use a local cache files, fetch from index directly. Mutually exclusive with ( Choices:
|
|
Whether the package should be installed or removed. Choices:
|
|
Update the package cache ( Choices:
|
Attributes
Attribute |
Support |
Description |
|---|---|---|
Support: full |
Can run in |
|
Support: none |
Returns details on what has changed (or possibly needs changing in |
|
Platform: OpenWrt |
Target platform for this module. |
Examples
- name: Install a package
community.openwrt.apk:
name: vim
state: present
- name: Remove a package
community.openwrt.apk:
name: vim
state: absent
- name: Update cache and install multiple packages
community.openwrt.apk:
name: curl,wget
state: present
update_cache: true
- name: Install package without using local cache
community.openwrt.apk:
name: tcpdump
state: present
no_cache: true