Skip to content

Commit

Permalink
Merge pull request #53 from petr-balogh/master
Browse files Browse the repository at this point in the history
Allow install docker also on RHEL OS
  • Loading branch information
paulfantom authored Jun 19, 2018
2 parents 5273d05 + 7bba7b4 commit 4f40e8d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tasks/install.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,22 +22,22 @@
- block:
- name: add GPG key
apt_key:
url: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
url: "https://download.docker.com/linux/{{ docker_repo_distribution }}/gpg"
state: present

- name: add docker repository | Debian
apt_repository:
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable"
repo: "deb [arch=amd64] https://download.docker.com/linux/{{ docker_repo_distribution }} {{ ansible_distribution_release }} stable"
state: present
when: ansible_os_family == "Debian"

- name: add docker repository | RedHat
yum_repository:
name: docker-ce-stable
description: "Docker CE Stable - $basearch"
baseurl: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/$releasever/$basearch/stable"
baseurl: "https://download.docker.com/linux/{{ docker_repo_distribution }}/{{ ansible_distribution_major_version }}/$basearch/stable"
gpgcheck: true
gpgkey: "https://download.docker.com/linux/{{ ansible_distribution | lower }}/gpg"
gpgkey: "https://download.docker.com/linux/{{ docker_repo_distribution }}/gpg"
when: ansible_os_family == "RedHat" and ansible_distribution != "OracleLinux"

- name: Install docker
Expand Down
1 change: 1 addition & 0 deletions vars/main.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
docker_gpg_key: 58118E89F3A912897C070ADBF76221572C52609D
key_server: hkp://p80.pool.sks-keyservers.net:80
docker_repo_distribution: "{{ ansible_distribution | lower }}"
2 changes: 2 additions & 0 deletions vars/redhat.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# allows also install on RHEL with CentOS repos.
docker_repo_distribution: "{{ (ansible_distribution == 'RedHat')| ternary('centos', ansible_distribution) | lower }}"
docker_package: "docker-ce{{ (docker_version != 'latest') | ternary('-' ~ docker_version ~ '*', '') }}"
docker_dependencies:
- ca-certificates
Expand Down

0 comments on commit 4f40e8d

Please sign in to comment.