snyssen.compose_deploy
snyssen.compose_deploy
This is a simple role that helps in deploying docker-compose.yml
files and managing the software stacks defined in them.
The docker-compose.yml
file (and an optional .env
file) should be in the usual templates folder with the filenames docker-compose.yml
and .env.j2
, respectively.
Requirements
Check the requirements for community.docker.docker_compose module.
Role Variables
Variable | Description | Default Value |
---|---|---|
stack_name | The name of the container stack; used to create the docker_compose_path with a default value. |
unspecified |
docker_compose_directory | The directory where the compose directories will be stored. | {{ ansible_user_dir }}/containers |
docker_compose_path | The full path to the directory for the deployed docker-compose.yml file. |
{{ docker_compose_directory }}/{{ stack_name }} |
deploy_env_template | Indicates whether to look for a .env.j2 template to deploy with the docker-compose.yml file. |
false |
docker_compose_state | The state that the stack should be in after deployment. For possible values, see the community.docker.docker_compose module documentation. | present |
Dependencies
None
Example Playbook
The following playbook will find the first docker-compose.yml
template it can locate (typically in the nearest templates
directory as per Ansible rules) and deploy it to /home/$USER/containers/my-container-stack/docker-compose.yml
(after processing it through the Ansible templating engine). Lastly, it will execute docker compose up -d
.
- hosts: all
roles:
- name: snyssen.container_deploy
vars:
stack_name: my-container-stack
License
GPL-3.0
Author Information
Email: [email protected]
Website: snyssen.be
Informazioni sul progetto
Deploys a given docker-compose.yml file and optionally its accompanying .env file.
Installa
ansible-galaxy install snyssen.compose_deploy
Licenza
gpl-3.0
Download
5k
Proprietario
Full-stack software & DevOps engineer