Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow install docker also on RHEL OS #53

Merged
merged 1 commit into from
Jun 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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