community.general.pkgin module – Package manager for SmartOS, NetBSD, et al
Note
This module is part of the community.general collection (version 10.1.0).
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.pkgin
.
Synopsis
The standard package manager for SmartOS, but also usable on NetBSD or any OS that uses
pkgsrc
. (Home: http://pkgin.net/)
Parameters
Parameter |
Comments |
---|---|
Clean packages cache Choices:
|
|
Force package reinstall Choices:
|
|
Upgrade all packages to their newer versions Choices:
|
|
Name of package to install/remove; multiple names may be given, separated by commas |
|
Intended state of the package Choices:
|
|
Update repository database. Can be run with other steps or on it’s own. Choices:
|
|
Upgrade main packages to their newer versions 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
Known bug with pkgin < 0.8.0: if a package is removed and another package depends on it, the other package will be silently removed as well.
Examples
- name: Install package foo
community.general.pkgin:
name: foo
state: present
- name: Install specific version of foo package
community.general.pkgin:
name: foo-2.0.1
state: present
- name: Update cache and install foo package
community.general.pkgin:
name: foo
update_cache: true
- name: Remove package foo
community.general.pkgin:
name: foo
state: absent
- name: Remove packages foo and bar
community.general.pkgin:
name: foo,bar
state: absent
- name: Update repositories as a separate step
community.general.pkgin:
update_cache: true
- name: Upgrade main packages (equivalent to pkgin upgrade)
community.general.pkgin:
upgrade: true
- name: Upgrade all packages (equivalent to pkgin full-upgrade)
community.general.pkgin:
full_upgrade: true
- name: Force-upgrade all packages (equivalent to pkgin -F full-upgrade)
community.general.pkgin:
full_upgrade: true
force: true
- name: Clean packages cache (equivalent to pkgin clean)
community.general.pkgin:
clean: true