Get installation working on CentOS, add Debian 8 test.

This commit is contained in:
Jeff Geerling 2017-02-23 22:21:00 -06:00
parent da3eb9cf1c
commit 5c864acf13
4 changed files with 22 additions and 13 deletions

View File

@ -8,9 +8,9 @@ env:
- distro: ubuntu1604
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
- distro: ubuntu1404
init: /sbin/init
run_opts: ""
- distro: debian8
init: /lib/systemd/systemd
run_opts: "--privileged --volume=/sys/fs/cgroup:/sys/fs/cgroup:ro"
before_install:
# Pull container.

View File

@ -3,3 +3,6 @@ docker_package: "docker-engine"
# 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 RedHat/CentOS.
docker_yum_repo_version: 'main' # 'testing', 'beta', 'nightly'

View File

@ -1,13 +1,13 @@
---
# - name: Add Docker GPG key.
# rpm_key:
# key: https://apt.dockerproject.org/gpg
# state: present
- name: Add Docker GPG key.
rpm_key:
key: https://yum.dockerproject.org/gpg
state: present
- name: Add Docker repository.
yum_repository:
name: docker
description: Docker repository.
baseurl: https://docs.docker.com/engine/installation/linux/repo_files/centos/docker.repo
gpgkey: https://apt.dockerproject.org/gpg
gpgcheck: yes
template:
src: 'docker.repo.j2'
dest: '/etc/yum.repos.d/docker.repo'
owner: root
group: root
mode: 0644

6
templates/docker.repo.j2 Normal file
View File

@ -0,0 +1,6 @@
[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