community.general.capabilities (8.5.0) — module

Manage Linux capabilities

Authors: Nate Coraor (@natefoo)

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

This module manipulates files privileges using the Linux capabilities(7) system.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Set cap_sys_chroot+ep on /foo
  community.general.capabilities:
    path: /foo
    capability: cap_sys_chroot+ep
    state: present
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove cap_net_bind_service from /bar
  community.general.capabilities:
    path: /bar
    capability: cap_net_bind_service
    state: absent

Inputs

    
path:
    aliases:
    - key
    description:
    - Specifies the path to the file to be managed.
    required: true
    type: str

state:
    choices:
    - absent
    - present
    default: present
    description:
    - Whether the entry should be present or absent in the file's capabilities.
    type: str

capability:
    aliases:
    - cap
    description:
    - Desired capability to set (with operator and flags, if O(state=present)) or remove
      (if O(state=absent))
    required: true
    type: str