Packages

Synopsis

The dictionary cl_packages comprises managed packages (Linux or BSD) or BSD ports.

FreeBSD

Packages will be installed by default. If you want to install ports set

freebsd_install_method: ports

In this case, the default is to use packages

freebsd_use_packages: true

See the variables freebsd_pkgng_* in packages.yml. There are no defaults. If these variables are not defined, the options are omitted. See the module community.general.pkgng. For example, disable use_globs (default=true) if you want to use the packages in the form <pkg-origin>

freebsd_pkgng_use_globs: false

Enable cached packages (default=false)

freebsd_pkgng_cached: true

This is especially useful when you install packages from a host in jails. For example,

freebsd_pkgng_delegate: iocage_host.example.com

In this case, you have to provide also freebsd_pkgng_jail.

See also

The defaults of the Ansible module community.general.pkgng

snap

By default, snap packages won’t be installed or uninstalled if snap binary can’t be found in cl_snap_paths. If you want the role to fail when snap is missing set

cl_snap_missing_fatal: true

The variables cl_snap_missing_fatal, cl_snap_paths, cl_snap_patterns are declared in defaults/main.yml.

Parameters

Parameter

Type

Comments

name

list required

List of packages or BSD ports

module

string

Ansible module to manage packages.
choices: package, apt, yum, snap, pkgng
(default=package)

state

string

State of packages or BSD ports
(default=present)

.

.

<TBD: see tasks/packages.yml>

Examples

FreeBSD install Postfix package or port

[contrib/postfix/conf-light/packages.d/postfix.yml]

1---
2postfix:
3  module: pkgng
4  name:
5    - mail/postfix

Armbian package for Simple SMTP

[contrib/ssmtp/conf-light/packages.d/ssmtp.yml]

1---
2ssmtp:
3  module: pkgng
4  name:
5    - mail/ssmtp

Ubuntu delete snap packages

[contrib/ubuntu-snap-disable/conf-light/packages.d/snap-deinstall.yml]

 1---
 2snap_deinstall_list1:
 3  module: snap
 4  state: absent
 5  name:
 6    - chromium
 7    - core
 8    - core18
 9    - gnome-3-28-1804
10    - gtk-common-themes
11    - simplenote
12    - tusk
13#   - snapd
14#
15# msg: Ooops! Snap installation failed while executing 'sh -c "/usr/bin/snap remove chromium core
16# core18 gnome-3-28-1804 gtk-common-themes simplenote snapd tusk"', please examine logs and error
17# output for more details.
18# rc: 1
19# stderr: |-
20#   error: cannot remove "chromium", "core", "core18", "gnome-3-28-1804",
21#          "gtk-common-themes", "simplenote", "snapd", "tusk": snap "snapd" is not
22#          removable: remove all other snaps first

Ubuntu purge snapd package

[contrib/ubuntu-snap-disable/conf-light/packages.d/snapd.yml]

1---
2snap_deinstall_list2:
3  module: apt
4  state: absent
5  purge: true
6  name:
7    - snapd