community.general.portinstall module – Installing packages from FreeBSD’s ports system

Note

This module is part of the community.general collection (version 9.5.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.portinstall.

Synopsis

  • Manage packages for FreeBSD using ‘portinstall’.

Parameters

Parameter

Comments

name

aliases: pkg

string / required

name of package to install/remove

state

string

state of the package

Choices:

  • "present" ← (default)

  • "absent"

use_packages

boolean

use packages instead of ports whenever available

Choices:

  • false

  • true ← (default)

Attributes

Attribute

Support

Description

check_mode

Support: none

Can run in check_mode and return changed status prediction without modifying target.

diff_mode

Support: none

Will return details on what has changed (or possibly needs changing in check_mode), when in diff mode.

Examples

- name: Install package foo
  community.general.portinstall:
    name: foo
    state: present

- name: Install package security/cyrus-sasl2-saslauthd
  community.general.portinstall:
    name: security/cyrus-sasl2-saslauthd
    state: present

- name: Remove packages foo and bar
  community.general.portinstall:
    name: foo,bar
    state: absent

Authors

  • berenddeboer (@berenddeboer)