dockercompose
Ansible Role: dockercompose
Role to install (by default) docker-compose on Debian/Ubuntu and EL systems.
Requirements
None.
Role Variables
Available variables are listed below (located in defaults/main.yml
):
Variables list:
dockercompose_app: docker-compose
dockercompose_version: 2.29.2
dockercompose_os: "{{ ansible_system | lower }}"
dockercompose_arch: "x86_64"
dockercompose_architecture_map:
amd64: x86_64
arm: arm64
x86_64: x86_64
armv6l: armv6
armv7l: armv7
aarch64: arm64
32-bit: "386"
64-bit: x86_64
dockercompose_dl_url: https://github.com/docker/compose/releases/download/v{{ dockercompose_version }}/{{ dockercompose_app }}-{{ dockercompose_os }}-{{ dockercompose_architecture_map[ansible_architecture] }}
dockercompose_bin_path: /usr/local/bin
dockercompose_file_owner: root
dockercompose_file_group: root
dockercompose_file_mode: '0755'
Variables table:
Variable | Description |
---|---|
dockercompose_app | Defines the app to install i.e. docker-compose |
dockercompose_version | Defined to dynamically fetch the desired version to install. Defaults to: 2.29.2 |
dockercompose_os | Defines OS type. Used for obtaining the correct type of binaries based on OS. |
dockercompose_architecture_map | Used for obtaining the correct type of binaries based on Architecture. |
dockercompose_dl_url | Defines URL to download the docker-compose binary from. |
dockercompose_bin_path | Defined to dynamically set the appropriate path to store docker-compose binary into. Defaults to (as generally available on any user's PATH): /usr/local/bin |
dockercompose_owner | Owner for the binary file of docker-compose. |
dockercompose_group | Group for the binary file of docker-compose. |
dockercompose_file_mode | Mode for the binary file of docker-compose. |
Dependencies
None
Example Playbook
For default behaviour of role (i.e. installation of dockercompose) in ansible playbooks.
- hosts: servers
roles:
- darkwizard242.dockercompose
For customizing behavior of role (i.e. specifying the desired dockercompose version) in ansible playbooks.
- hosts: servers
roles:
- darkwizard242.dockercompose
vars:
dockercompose_version: 1.26.0
For customizing behavior of role (i.e. placing binary of dockercompose package in different location) in ansible playbooks.
- hosts: servers
roles:
- darkwizard242.dockercompose
vars:
dockercompose_bin_path: /bin/
License
Author Information
This role was created by Ali Muhammad.
About
Installs/Uninstalls 'docker-compose' to define and run multi comtainer docker applications.
Install
ansible-galaxy install darkwizard242/ansible-role-dockercompose
License
mit
Downloads
4189
Owner
Senior DevOps/CloudOps Engineer.
Dedicated to Automating everything I come across.
Love to work on and learn new technologies/tools everyday!