community.general.opkg (6.6.8) — module

Package manager for OpenWrt and Openembedded/Yocto based Linux distributions

Authors: Patrick Pelletier (@skinp)

Install collection

Install with ansible-galaxy collection install community.general:==6.6.8


Add to requirements.yml

  collections:
    - name: community.general
      version: 6.6.8

Description

Manages ipk packages for OpenWrt and Openembedded/Yocto based Linux distributions


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install foo
  community.general.opkg:
    name: foo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install foo in version 1.2 (opkg>=0.3.2 on Yocto based Linux distributions)
  community.general.opkg:
    name: foo=1.2
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update cache and install foo
  community.general.opkg:
    name: foo
    state: present
    update_cache: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove foo
  community.general.opkg:
    name: foo
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove foo and bar
  community.general.opkg:
    name:
      - foo
      - bar
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install foo using overwrite option forcibly
  community.general.opkg:
    name: foo
    state: present
    force: overwrite

Inputs

    
name:
    aliases:
    - pkg
    description:
    - Name of package(s) to install/remove.
    - C(NAME=VERSION) syntax is also supported to install a package in a certain version.
      See the examples. This only works on Yocto based Linux distributions (opkg>=0.3.2)
      and not for OpenWrt. This is supported since community.general 6.2.0.
    elements: str
    required: true
    type: list

force:
    choices:
    - ''
    - depends
    - maintainer
    - reinstall
    - overwrite
    - downgrade
    - space
    - postinstall
    - remove
    - checksum
    - removal-of-dependent-packages
    default: ''
    description:
    - The C(opkg --force) parameter used.
    type: str

state:
    choices:
    - present
    - absent
    - installed
    - removed
    default: present
    description:
    - State of the package.
    type: str

update_cache:
    default: false
    description:
    - Update the package DB first.
    type: bool