taruch.mycollection.pkgng (1.0.2) — module

Package manager for FreeBSD >= 9.0

Authors: bleader (@bleader)

Install collection

Install with ansible-galaxy collection install taruch.mycollection:==1.0.2


Add to requirements.yml

  collections:
    - name: taruch.mycollection
      version: 1.0.2

Description

Manage binary packages for FreeBSD using 'pkgng' which is available in versions after 9.0.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install package foo
  community.general.pkgng:
    name: foo
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Annotate package foo and bar
  community.general.pkgng:
    name:
      - foo
      - bar
    annotation: '+test1=baz,-test2,:test3=foobar'
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove packages foo and bar
  community.general.pkgng:
    name:
      - foo
      - bar
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# "latest" support added in 2.7
- name: Upgrade package baz
  community.general.pkgng:
    name: baz
    state: latest
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Upgrade all installed packages (see warning for the name option first!)
  community.general.pkgng:
    name: "*"
    state: latest

Inputs

    
jail:
    description:
    - Pkg will execute in the given jail name or id.
    - Can not be used together with I(chroot) or I(rootdir) options.
    type: str

name:
    aliases:
    - pkg
    description:
    - Name or list of names of packages to install/remove.
    - With I(name=*), I(state=latest) will operate, but I(state=present) and I(state=absent)
      will be noops.
    - 'Warning: In Ansible 2.9 and earlier this module had a misfeature where I(name=*)
      with I(state=latest) or I(state=present) would install every package from every
      package repository, filling up the machines disk. Avoid using them unless you are
      certain that your role will only be used with newer versions.

      '
    elements: str
    required: true
    type: list

state:
    choices:
    - present
    - latest
    - absent
    default: present
    description:
    - State of the package.
    - 'Note: C(latest) added in 2.7.'
    required: false
    type: str

cached:
    default: false
    description:
    - Use local package base instead of fetching an updated one.
    required: false
    type: bool

chroot:
    description:
    - Pkg will chroot in the specified environment.
    - Can not be used together with I(rootdir) or I(jail) options.
    required: false
    type: path

pkgsite:
    description:
    - For pkgng versions before 1.1.4, specify packagesite to use for downloading packages.
      If not specified, use settings from C(/usr/local/etc/pkg.conf).
    - For newer pkgng versions, specify a the name of a repository configured in C(/usr/local/etc/pkg/repos).
    required: false
    type: str

rootdir:
    description:
    - For pkgng versions 1.5 and later, pkg will install all packages within the specified
      root directory.
    - Can not be used together with I(chroot) or I(jail) options.
    required: false
    type: path

annotation:
    description:
    - A list of keyvalue-pairs of the form C(<+/-/:><key>[=<value>]). A C(+) denotes adding
      an annotation, a C(-) denotes removing an annotation, and C(:) denotes modifying
      an annotation. If setting or modifying annotations, a value must be provided.
    elements: str
    required: false
    type: list

autoremove:
    default: false
    description:
    - Remove automatically installed packages which are no longer needed.
    required: false
    type: bool

ignore_osver:
    default: false
    description:
    - Ignore FreeBSD OS version check, useful on -STABLE and -CURRENT branches.
    - Defines the C(IGNORE_OSVERSION) environment variable.
    required: false
    type: bool
    version_added: 1.3.0
    version_added_collection: taruch.mycollection