mirror of
https://github.com/geerlingguy/ansible-role-docker.git
synced 2024-11-18 19:10:43 +01:00
Merge pull request #6 from geerlingguy/5-switch-to-new-repos
Fixes #5: Switch to new Docker CE and EE repo layout.
This commit is contained in:
commit
4c742428b6
@ -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_install_compose: true
|
||||
docker_compose_version: "1.13.0"
|
||||
docker_compose_path: /usr/local/bin/docker-compose
|
||||
|
||||
# Used only for Debian/Ubuntu. Add 'testing' if you don't want stable.
|
||||
docker_apt_repository: "deb https://apt.dockerproject.org/repo {{ ansible_distribution|lower }}-{{ ansible_distribution_release }} main"
|
||||
# Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed.
|
||||
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.
|
||||
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
|
||||
|
@ -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.
|
||||
apt:
|
||||
name: "{{ item }}"
|
||||
@ -9,8 +17,8 @@
|
||||
|
||||
- name: Add Docker apt key.
|
||||
apt_key:
|
||||
url: https://apt.dockerproject.org/gpg
|
||||
id: 58118E89F3A912897C070ADBF76221572C52609D
|
||||
url: https://download.docker.com/linux/ubuntu/gpg
|
||||
id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88
|
||||
state: present
|
||||
|
||||
- name: Add Docker repository.
|
||||
|
@ -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.
|
||||
rpm_key:
|
||||
key: https://yum.dockerproject.org/gpg
|
||||
key: https://download.docker.com/linux/centos/gpg
|
||||
state: present
|
||||
|
||||
- name: Add Docker repository.
|
||||
template:
|
||||
src: 'docker.repo.j2'
|
||||
dest: '/etc/yum.repos.d/docker.repo'
|
||||
get_url:
|
||||
url: "{{ docker_yum_repo_url }}"
|
||||
dest: '/etc/yum.repos.d/docker-{{ docker_edition }}.repo'
|
||||
owner: root
|
||||
group: root
|
||||
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 }}'
|
||||
|
@ -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
|
Loading…
Reference in New Issue
Block a user