community.general.pkgng module – Package manager for FreeBSD >= 9.0
Note
This module is part of the community.general collection (version 10.7.5).
You might already have this collection installed if you are using the ansible package.
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.general.
To use it in a playbook, specify: community.general.pkgng.
Synopsis
- Manage binary packages for FreeBSD using - pkgngwhich is available in versions after 9.0.
Parameters
| Parameter | Comments | 
|---|---|
| A list of keyvalue-pairs of the form  | |
| Remove automatically installed packages which are no longer needed. Choices: 
 | |
| Use local package base instead of fetching an updated one. Choices: 
 | |
| Ignore FreeBSD OS version check, useful on  Defines the  Choices: 
 | |
| Name or list of names of packages to install/remove. With  | |
| For  For newer  | |
| State of the package. Choices: 
 | |
| Treat the package names as shell glob patterns. Choices: 
 | 
Attributes
| Attribute | Support | Description | 
|---|---|---|
| Support: full | Can run in  | |
| Support: none | Will return details on what has changed (or possibly needs changing in  | 
Notes
Note
- When using pkgsite, be careful that already in cache packages are not downloaded again. 
- When used with a - loop:each package is processed individually, it is much more efficient to pass the list directly to the- nameoption.
Examples
- name: Install package foo
  community.general.pkgng:
    name: foo
    state: present
- name: Annotate package foo and bar
  community.general.pkgng:
    name:
      - foo
      - bar
    annotation: '+test1=baz,-test2,:test3=foobar'
- name: Remove packages foo and bar
  community.general.pkgng:
    name:
      - foo
      - bar
    state: absent
- name: Upgrade package baz
  community.general.pkgng:
    name: baz
    state: latest
- name: Upgrade all installed packages (see warning for the name option first!)
  community.general.pkgng:
    name: "*"
    state: latest
- name: Upgrade foo/bar
  community.general.pkgng:
    name: foo/bar
    state: latest
    use_globs: false
