Skip to content
This repository has been archived by the owner on Jul 12, 2021. It is now read-only.

Ansible role to deploy applications via `docker-compose`.

License

Notifications You must be signed in to change notification settings

lawliet89/docker-compose-ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-compose-ansible

Ansible role to deploy applications via docker-compose.

Requirements

The deploying host which is running the playbook should have at least Ansible 2.3 so that the bug with copy module not preserving permissions is fixed.

The target host should have docker, docker-compose and the python library docker-py installed.

Role Variables

  • code_source: 'local' or git. Set to local to get source code from the host machine, or git from a git repository.
  • git_repo: URL for a git repository.
  • get_local_commit: If code_source is set to git and this is set to true, will get a commit from the local directory instead of using a branch.
  • git_repo_version: If code_source is set to git, specify a commit or branch name to deploy
  • docker_compose_files: An array of docker-compose files to use to deploy
  • local_path: if code_source is local or if get_local_commit is true, the path to the local source code.
  • project_directory: The path on the target host to deploy source code to.
  • remove_volumes: Set to yes to remove existing volumes while deploying. Defaults to no.
  • pull_images: Set to True to pull images from a registry before creating the containers. Defaults to True.
  • build_images: Set to True to build images for containers. Defaults to True.
  • docker_become: Set to True to become with docker commands.

Example Playbook

---
- 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"

License

Apache 2.0

TODO

Write tests

About

Ansible role to deploy applications via `docker-compose`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published