W3cubDocs

/Ansible

pkgng - Package manager for FreeBSD >= 9.0

Synopsis

  • Manage binary packages for FreeBSD using ‘pkgng’ which is available in versions after 9.0.

Options

parameter required default choices comments
annotation
(added in 1.6)
no
A comma-separated list of keyvalue-pairs of the form <+/-/:><key>[=<value>]. A + denotes adding an annotation, a - denotes removing an annotation, and : denotes modifying an annotation. If setting or modifying annotations, a value must be provided.
autoremove
(added in 2.2)
no
  • yes
  • no
Remove automatically installed packages which are no longer needed.
cached
no
  • yes
  • no
Use local package base instead of fetching an updated one.
chroot
(added in 2.1)
no
Pkg will chroot in the specified environment.
Can not be used together with rootdir or jail options.
jail
(added in 2.4)
no
Pkg will execute in the given jail name or id.
Can not be used together with chroot or rootdir options.
name
yes
Name of package to install/remove.
pkgsite
no
For pkgng versions before 1.1.4, specify packagesite to use for downloading packages. If not specified, use settings from /usr/local/etc/pkg.conf.
For newer pkgng versions, specify a the name of a repository configured in /usr/local/etc/pkg/repos.
rootdir
no
For pkgng versions 1.5 and later, pkg will install all packages within the specified root directory.
Can not be used together with chroot or jail options.
state
no present
  • present
  • absent
State of the package.

Examples

# Install package foo
- pkgng:
    name: foo
    state: present

# Annotate package foo and bar
- pkgng:
    name: foo,bar
    annotation: '+test1=baz,-test2,:test3=foobar'

# Remove packages foo and bar
- pkgng:
    name: foo,bar
    state: absent

Notes

Note

  • When using pkgsite, be careful that already in cache packages won’t be downloaded again.

Status

This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.

For help in developing on modules, should you be so inclined, please read Community Information & Contributing, Testing Ansible and Developing Modules.

© 2012–2017 Michael DeHaan
© 2017 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/pkgng_module.html