Fixes #5: Switch to new Docker CE and EE repo layout.

This commit is contained in:
Jeff Geerling 2017-05-09 21:36:53 -05:00
parent 3ae29c13ab
commit a220d54d4a
4 changed files with 48 additions and 16 deletions

View File

@ -1,13 +1,18 @@
--- ---
docker_package: "docker-engine" # Edition can be one of: 'ce' (Community Edition) or 'ee' (Enterprise Edition).
docker_edition: 'ce'
docker_package: "docker-{{ docker_edition }}"
# Docker Compose options. # Docker Compose options.
docker_install_compose: true docker_install_compose: true
docker_compose_version: "1.13.0" docker_compose_version: "1.13.0"
docker_compose_path: /usr/local/bin/docker-compose docker_compose_path: /usr/local/bin/docker-compose
# Used only for Debian/Ubuntu. Add 'testing' if you don't want stable. # Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed.
docker_apt_repository: "deb https://apt.dockerproject.org/repo {{ ansible_distribution|lower }}-{{ ansible_distribution_release }} main" docker_apt_release_channel: stable
docker_apt_repository: "deb [arch=amd64] https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}"
# Used only for RedHat/CentOS. # Used only for RedHat/CentOS.
docker_yum_repo_version: 'main' # 'testing', 'beta', 'nightly' docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo
docker_yum_repo_enable_edge: 0
docker_yum_repo_enable_test: 0

View File

@ -1,4 +1,12 @@
--- ---
- name: Ensure old versions of Docker are not installed.
package:
name: '{{ item }}'
state: absent
with_items:
- docker
- docker-engine
- name: Ensure depdencies are installed. - name: Ensure depdencies are installed.
apt: apt:
name: "{{ item }}" name: "{{ item }}"
@ -9,8 +17,8 @@
- name: Add Docker apt key. - name: Add Docker apt key.
apt_key: apt_key:
url: https://apt.dockerproject.org/gpg url: https://download.docker.com/linux/ubuntu/gpg
id: 58118E89F3A912897C070ADBF76221572C52609D id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
state: present state: present
- name: Add Docker repository. - name: Add Docker repository.

View File

@ -1,13 +1,38 @@
--- ---
- name: Ensure old versions of Docker are not installed.
package:
name: '{{ item }}'
state: absent
with_items:
- docker
- docker-common
- container-selinux
- docker-selinux
- docker-engine
- name: Add Docker GPG key. - name: Add Docker GPG key.
rpm_key: rpm_key:
key: https://yum.dockerproject.org/gpg key: https://download.docker.com/linux/centos/gpg
state: present state: present
- name: Add Docker repository. - name: Add Docker repository.
template: get_url:
src: 'docker.repo.j2' url: "{{ docker_yum_repo_url }}"
dest: '/etc/yum.repos.d/docker.repo' dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
owner: root owner: root
group: root group: root
mode: 0644 mode: 0644
- name: Configure Docker Edge repo.
ini_file:
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
section: 'docker-{{ docker_edition }}-edge'
option: enabled
value: '{{ docker_yum_repo_enable_edge }}'
- name: Configure Docker Test repo.
ini_file:
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
section: 'docker-{{ docker_edition }}-test'
option: enabled
value: '{{ docker_yum_repo_enable_test }}'

View File

@ -1,6 +0,0 @@
[docker-{{ docker_yum_repo_version }}]
name=Docker Repository
baseurl=https://yum.dockerproject.org/repo/{{ docker_yum_repo_version }}/{{ ansible_distribution|lower }}/{{ ansible_distribution_version.split(".")[0]|int }}/
enabled=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg