Ansible role to deploy applications via docker-compose.
The target host should have docker, docker-compose and the python library docker-py installed.
code_source: 'local' orgit. Set tolocalto get source code from the host machine, orgitfrom a git repository.git_repo: URL for a git repository.get_local_commit: Ifcode_sourceis set togitand this is set totrue, will get a commit from the local directory instead of using a branch.git_repo_version: Ifcode_sourceis set togit, specify a commit or branch name to deploydocker_compose_files: An array ofdocker-composefiles to use to deploylocal_path: ifcode_sourceislocalor ifget_local_commitis true, the path to the local source code.project_directory: The path on the target host to deploy source code to.remove_volumes: Set toyesto remove existing volumes while deploying. Defaults tono.pull_images: Set toTrueto pull images from a registry before creating the containers. Defaults toTrue.build_images: Set toTrueto build images for containers. Defaults toTrue.docker_become: Set toTruetobecomewith docker commands.
---
- name: "Deploy Application"
hosts: all
roles:
- role: docker_compose_deploy
code_source: 'local'
project_directory: "/home/{{ ansible_user_id }}/app"
local_path: "{{ playbook_dir }}/app"
LGPL
Write tests