From 5c864acf136b1d61c772dfe7be08cdaf850a63a6 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Thu, 23 Feb 2017 22:21:00 -0600 Subject: [PATCH] Get installation working on CentOS, add Debian 8 test. --- .travis.yml | 6 +++--- defaults/main.yml | 3 +++ tasks/setup-RedHat.yml | 20 ++++++++++---------- templates/docker.repo.j2 | 6 ++++++ 4 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 templates/docker.repo.j2 diff --git a/.travis.yml b/.travis.yml index a2e48eb..e05159b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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. diff --git a/defaults/main.yml b/defaults/main.yml index 2e61d13..298433a 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -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' diff --git a/tasks/setup-RedHat.yml b/tasks/setup-RedHat.yml index 69c1319..455eb90 100644 --- a/tasks/setup-RedHat.yml +++ b/tasks/setup-RedHat.yml @@ -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 diff --git a/templates/docker.repo.j2 b/templates/docker.repo.j2 new file mode 100644 index 0000000..d30e695 --- /dev/null +++ b/templates/docker.repo.j2 @@ -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