community.general.opkg (8.5.0) — 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:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

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
    description:
    - The C(opkg --force) parameter used.
    - Passing V("") as value and not passing any value at all have both the same effect
      of B(not) using any C(--force-) parameter.
    type: str

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

executable:
    description:
    - The executable location for C(opkg).
    type: path
    version_added: 7.2.0
    version_added_collection: community.general

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