Add support for archlinux

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-05-12 12:12:22 +02:00
parent 99772a2fb5
commit 2b1114268c
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
6 changed files with 43 additions and 16 deletions

View File

@ -4,6 +4,7 @@ This role installs latest docker-compose on a host and start it as a systemd dae
## Requirements ## Requirements
- Archlinux
- Debian >= 8 (jessie) - Debian >= 8 (jessie)
- Ubuntu >= 16.04 (xenial) - Ubuntu >= 16.04 (xenial)
- Docker - Docker

View File

@ -18,6 +18,8 @@ galaxy_info:
versions: versions:
- jessie - jessie
- stretch - stretch
- name: Archlinux
versions: [all]
categories: categories:
#- cloud #- cloud

11
tasks/Archlinux.yml Normal file
View 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
View File

@ -0,0 +1,5 @@
---
- include: Ubuntu.yml
...

17
tasks/Ubuntu.yml Normal file
View 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"
...

View File

@ -2,17 +2,8 @@
# Install docker-compose # Install docker-compose
- name: Ensure pip to be available - name: "Loading distribution specific instructions for {{ ansible_distribution }}"
apt: include: "{{ ansible_distribution }}.yml"
name: python-pip
cache_valid_time: 86400
- name: Install or update docker-compose
pip:
name: docker-compose
executable: pip
state: latest
register: docker_compose
# Configure docker-compose # Configure docker-compose
@ -51,13 +42,13 @@
Type=oneshot Type=oneshot
RemainAfterExit=yes RemainAfterExit=yes
ExecStartPre=-/usr/local/bin/docker-compose pull --quiet --ignore-pull-failures ExecStartPre=-{{ docker_compose_binary_path }} pull --quiet --ignore-pull-failures
ExecStart=/usr/local/bin/docker-compose up -d --remove-orphans 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={{ docker_compose_binary_path }} pull --quiet --ignore-pull-failures
ExecReload=/usr/local/bin/docker-compose up -d --remove-orphans ExecReload={{ docker_compose_binary_path }} up -d --remove-orphans
[Install] [Install]
WantedBy=docker.service WantedBy=docker.service