Skip to content

dpkg_selections

Collection Note

This module is part of the ansible.builtin collection. To install the collection, use:

ansible-galaxy collection install ansible.builtin
Added in version 2.0.

Synopsis

  • Change dpkg package selection state via C(--get-selections) and C(--set-selections).

Parameters

Parameter Defaults / Choices Comments
name
str
required
Name of the package.
selection
str
required
Choices: install, hold, deinstall, purge The selection state to set the package to.

Notes

Note

  • This module will not cause any packages to be installed/removed/purged, use the M(ansible.builtin.apt) module for that.

Examples

- name: Prevent python from being upgraded
  ansible.builtin.dpkg_selections:
    name: python
    selection: hold

- name: Allow python to be upgraded
  ansible.builtin.dpkg_selections:
    name: python
    selection: install

Authors