community.docker.nsenter (3.8.1) — connection

execute on host running controller container

| "added in version" 1.9.0 of community.docker"

Authors: Jeff Goldschrafe (@jgoldschrafe)

Install collection

Install with ansible-galaxy collection install community.docker:==3.8.1


Add to requirements.yml

  collections:
    - name: community.docker
      version: 3.8.1

Description

This connection plugin allows Ansible, running in a privileged container, to execute tasks on the container host instead of in the container itself.

This is useful for running Ansible in a pull model, while still keeping the Ansible control node containerized.

It relies on having privileged access to run C(nsenter) in the host's PID namespace, allowing it to enter the namespaces of the provided PID (default PID 1, or init/systemd).

Inputs

    
nsenter_pid:
    default: 1
    description:
    - PID to attach with using nsenter.
    - The default should be fine unless you are attaching as a non-root user.
    env:
    - name: ANSIBLE_NSENTER_PID
    ini:
    - key: nsenter_pid
      section: nsenter_connection
    type: int
    vars:
    - name: ansible_nsenter_pid