community.openwrt.opkg module – Manage packages with opkg on OpenWrt
Note
This module is part of the community.openwrt collection (version 1.8.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.opkg.
Synopsis
The community.openwrt.opkg module manages packages on OpenWrt using the opkg package manager.
It can install, remove, and update packages.
Note
This module has a corresponding action plugin.
Parameters
Parameter |
Comments |
|---|---|
Remove dependencies that are no longer required when removing a package. Choices:
|
|
Path to a custom opkg configuration file, passed to opkg as This replaces the default opkg configuration entirely instead of adding to it, so the file must define its own Useful on devices where the default opkg configuration does not provide the desired feeds (for example, Teltonika firmware). |
|
Force option to pass to opkg. Choices:
|
|
Name of the package(s) to install or remove. Multiple packages can be specified as a comma-separated list. |
|
Do not follow dependencies. 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.opkg:
name: vim
state: present
- name: Remove a package
community.openwrt.opkg:
name: vim
state: absent
- name: Install multiple packages
community.openwrt.opkg:
name: vim,curl,wget
state: present
- name: Update cache and install package
community.openwrt.opkg:
name: nginx
state: present
update_cache: true
- name: Force reinstall a package
community.openwrt.opkg:
name: busybox
state: present
force: reinstall
- name: Install a package using a custom opkg configuration file
community.openwrt.opkg:
name: python3-base
state: present
conf_file: /etc/opkg/openwrt.conf