docker_stack – docker stack module¶
New in version 2.8.
Synopsis¶
Manage docker stacks using the ‘docker stack’ command on the target node (see examples).
Requirements¶
The below requirements are needed on the host that executes this module.
jsondiff
pyyaml
Parameters¶
Examples¶
- name: Deploy stack from a compose file
docker_stack:
state: present
name: mystack
compose:
- /opt/docker-compose.yml
- name: Deploy stack from base compose file and override the web service
docker_stack:
state: present
name: mystack
compose:
- /opt/docker-compose.yml
- version: '3'
services:
web:
image: nginx:latest
environment:
ENVVAR: envvar
- name: Remove stack
docker_stack:
name: mystack
state: absent
Return Values¶
Common return values are documented here, the following are the fields unique to this module:
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]