Add support for archlinux

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-05-12 12:00:32 +02:00
parent e90af1d307
commit aa8b89604d
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E
6 changed files with 48 additions and 20 deletions

View file

@ -4,6 +4,7 @@ This role installs latest docker-ce on a host, configures its startup parameters
## Requirements
- Archlinux
- Debian >= 8 (jessie)
- Ubuntu >= 16.04 (xenial)

View file

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

14
tasks/Archlinux.yml Normal file
View file

@ -0,0 +1,14 @@
---
- name: Install docker
pacman:
name: docker
update_cache: true
- name: Enable and start docker
systemd:
name: docker
enabled: true
state: started
...

5
tasks/Debian.yml Normal file
View file

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

24
tasks/Ubuntu.yml Normal file
View file

@ -0,0 +1,24 @@
---
- name: Install apt-key
apt_key:
id: 0EBFCD88
url: 'https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg'
keyring: /etc/apt/trusted.gpg.d/docker.gpg
- name: Ensure https transport to be available
apt:
name: apt-transport-https
cache_valid_time: 86400
- name: Activate apt-repo
apt_repository:
repo: 'deb https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_channel }}'
state: present
- name: Install docker
apt:
name: docker-ce
cache_valid_time: 86400
...

View file

@ -1,25 +1,7 @@
---
- name: Install apt-key
apt_key:
id: 0EBFCD88
url: 'https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg'
keyring: /etc/apt/trusted.gpg.d/docker.gpg
- name: Ensure https transport to be available
apt:
name: apt-transport-https
cache_valid_time: 86400
- name: Activate apt-repo
apt_repository:
repo: 'deb https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} {{ docker_channel }}'
state: present
- name: Install docker
apt:
name: docker-ce
cache_valid_time: 86400
- name: "Loading distribution specific instructions for {{ ansible_distribution }}"
include: "{{ ansible_distribution }}.yml"
- set_fact:
docker_global_ipv6: "{{ ansible_eth0.ipv6 | selectattr('scope', 'equalto', 'global') | first }}"