diff --git a/README.md b/README.md index 14ecb39..c7e91ad 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/meta/main.yml b/meta/main.yml index cb26b47..ff681bf 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -15,6 +15,8 @@ galaxy_info: versions: - jessie - stretch + - name: Archlinux + versions: [all] categories: #- cloud diff --git a/tasks/Archlinux.yml b/tasks/Archlinux.yml new file mode 100644 index 0000000..38ee74b --- /dev/null +++ b/tasks/Archlinux.yml @@ -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 + +... diff --git a/tasks/Debian.yml b/tasks/Debian.yml new file mode 100644 index 0000000..48cb971 --- /dev/null +++ b/tasks/Debian.yml @@ -0,0 +1,5 @@ +--- + +- include: Ubuntu.yml + +... diff --git a/tasks/Ubuntu.yml b/tasks/Ubuntu.yml new file mode 100644 index 0000000..191ec10 --- /dev/null +++ b/tasks/Ubuntu.yml @@ -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 + +... diff --git a/tasks/main.yml b/tasks/main.yml index fa2b0d6..5d6527c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -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 }}"