community.docker.docker – Run tasks in docker containers

Note

This plugin is part of the community.docker collection (version 1.10.2).

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.docker.

To use it in a playbook, specify: community.docker.docker.

Synopsis

  • Run commands or put/fetch files to an existing docker container.

  • Uses the Docker CLI to execute commands in the container. If you prefer to directly connect to the Docker daemon, use the community.docker.docker_api connection plugin.

Parameters

Parameter

Comments

docker_extra_args

string

Extra arguments to pass to the docker command line

Default: “”

remote_addr

string

The name of the container you want to access.

Default: “inventory_hostname”

Configuration:

  • Variable: ansible_host

  • Variable: ansible_docker_host

remote_user

string

The user to execute as inside the container

Configuration:

  • Variable: ansible_user

  • Variable: ansible_docker_user

Authors

  • Lorin Hochestein (!UNKNOWN)

  • Leendert Brouwer (!UNKNOWN)