mirror of
https://github.com/luzifer-ansible/docker-compose.git
synced 2024-12-22 09:01:15 +00:00
Add support for archlinux
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
99772a2fb5
commit
2b1114268c
6 changed files with 43 additions and 16 deletions
|
@ -4,6 +4,7 @@ This role installs latest docker-compose on a host and start it as a systemd dae
|
|||
|
||||
## Requirements
|
||||
|
||||
- Archlinux
|
||||
- Debian >= 8 (jessie)
|
||||
- Ubuntu >= 16.04 (xenial)
|
||||
- Docker
|
||||
|
|
|
@ -18,6 +18,8 @@ galaxy_info:
|
|||
versions:
|
||||
- jessie
|
||||
- stretch
|
||||
- name: Archlinux
|
||||
versions: [all]
|
||||
|
||||
categories:
|
||||
#- cloud
|
||||
|
|
11
tasks/Archlinux.yml
Normal file
11
tasks/Archlinux.yml
Normal file
|
@ -0,0 +1,11 @@
|
|||
---
|
||||
|
||||
- name: Install or update docker-compose
|
||||
pacman:
|
||||
name: docker-compose
|
||||
state: latest
|
||||
register: docker_compose
|
||||
|
||||
- set_fact: docker_compose_binary_path="/usr/bin/docker-compose"
|
||||
|
||||
...
|
5
tasks/Debian.yml
Normal file
5
tasks/Debian.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
|
||||
- include: Ubuntu.yml
|
||||
|
||||
...
|
17
tasks/Ubuntu.yml
Normal file
17
tasks/Ubuntu.yml
Normal file
|
@ -0,0 +1,17 @@
|
|||
---
|
||||
|
||||
- name: Ensure pip to be available
|
||||
apt:
|
||||
name: python-pip
|
||||
cache_valid_time: 86400
|
||||
|
||||
- name: Install or update docker-compose
|
||||
pip:
|
||||
name: docker-compose
|
||||
executable: pip
|
||||
state: latest
|
||||
register: docker_compose
|
||||
|
||||
- set_fact: docker_compose_binary_path="/usr/local/bin/docker-compose"
|
||||
|
||||
...
|
|
@ -2,17 +2,8 @@
|
|||
|
||||
# Install docker-compose
|
||||
|
||||
- name: Ensure pip to be available
|
||||
apt:
|
||||
name: python-pip
|
||||
cache_valid_time: 86400
|
||||
|
||||
- name: Install or update docker-compose
|
||||
pip:
|
||||
name: docker-compose
|
||||
executable: pip
|
||||
state: latest
|
||||
register: docker_compose
|
||||
- name: "Loading distribution specific instructions for {{ ansible_distribution }}"
|
||||
include: "{{ ansible_distribution }}.yml"
|
||||
|
||||
# Configure docker-compose
|
||||
|
||||
|
@ -51,13 +42,13 @@
|
|||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
|
||||
ExecStartPre=-/usr/local/bin/docker-compose pull --quiet --ignore-pull-failures
|
||||
ExecStart=/usr/local/bin/docker-compose up -d --remove-orphans
|
||||
ExecStartPre=-{{ docker_compose_binary_path }} pull --quiet --ignore-pull-failures
|
||||
ExecStart={{ docker_compose_binary_path }} up -d --remove-orphans
|
||||
|
||||
ExecStop=/usr/local/bin/docker-compose {{ docker_compose_stop_action }}
|
||||
ExecStop={{ docker_compose_binary_path }} {{ docker_compose_stop_action }}
|
||||
|
||||
ExecReload=/usr/local/bin/docker-compose pull --quiet --ignore-pull-failures
|
||||
ExecReload=/usr/local/bin/docker-compose up -d --remove-orphans
|
||||
ExecReload={{ docker_compose_binary_path }} pull --quiet --ignore-pull-failures
|
||||
ExecReload={{ docker_compose_binary_path }} up -d --remove-orphans
|
||||
|
||||
[Install]
|
||||
WantedBy=docker.service
|
||||
|
|
Loading…
Reference in a new issue