Parameter | Choices/Defaults | Comments |
---|---|---|
annotation (added in 1.6) | 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 bool (added in 2.2) |
| Remove automatically installed packages which are no longer needed. |
cached bool |
| Use local package base instead of fetching an updated one. |
chroot (added in 2.1) | Pkg will chroot in the specified environment. Can not be used together with rootdir or jail options. | |
jail (added in 2.4) | Pkg will execute in the given jail name or id. Can not be used together with chroot or rootdir options. | |
name required | Name or list of names of packages to install/remove. | |
pkgsite | 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 | 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 |
| State of the package. Note: "latest" added in 2.7 |
Note
loop:
each package will be processed individually, it is much more efficient to pass the list directly to the name
option.- name: Install package foo pkgng: name: foo state: present - name: Annotate package foo and bar pkgng: name: foo,bar annotation: '+test1=baz,-test2,:test3=foobar' - name: Remove packages foo and bar pkgng: name: foo,bar state: absent # "latest" support added in 2.7 - name: Upgrade package baz pkgng: name: baz state: latest
This module is flagged as preview which means that it is not guaranteed to have a backwards compatible interface.
This module is flagged as community which means that it is maintained by the Ansible Community. See Module Maintenance & Support for more info.
For a list of other modules that are also maintained by the Ansible Community, see here.
Hint
If you notice any issues in this documentation you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.7/modules/pkgng_module.html