From de50f37fea76908e55f772c7f9fffc7bbbb37e25 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Wed, 8 Feb 2017 19:19:08 +0900 Subject: [PATCH 1/2] enable proxy support on docker repository --- roles/docker/tasks/main.yml | 4 ++-- .../{files/rh_docker.repo => templates/rh_docker.repo.j2} | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) rename roles/docker/{files/rh_docker.repo => templates/rh_docker.repo.j2} (74%) diff --git a/roles/docker/tasks/main.yml b/roles/docker/tasks/main.yml index ead201408..339fe7c40 100644 --- a/roles/docker/tasks/main.yml +++ b/roles/docker/tasks/main.yml @@ -49,8 +49,8 @@ when: (not ansible_os_family in ["CoreOS", "Container Linux by CoreOS"]) and (docker_repo_info.repos|length > 0) - name: Configure docker repository on RedHat/CentOS - copy: - src: "rh_docker.repo" + template: + src: "rh_docker.repo.j2" dest: "/etc/yum.repos.d/docker.repo" when: ansible_distribution in ["CentOS","RedHat"] diff --git a/roles/docker/files/rh_docker.repo b/roles/docker/templates/rh_docker.repo.j2 similarity index 74% rename from roles/docker/files/rh_docker.repo rename to roles/docker/templates/rh_docker.repo.j2 index a66294c93..bc711d7fe 100644 --- a/roles/docker/files/rh_docker.repo +++ b/roles/docker/templates/rh_docker.repo.j2 @@ -4,3 +4,4 @@ baseurl=https://yum.dockerproject.org/repo/main/centos/7 enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg +{% if http_proxy %}proxy={{ http_proxy }}{% endif %} From 3eacd0c871b3c37d0a039903654ed618220bc1ad Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Wed, 8 Feb 2017 20:03:51 +0900 Subject: [PATCH 2/2] Update rh_docker.repo.j2 --- roles/docker/templates/rh_docker.repo.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/docker/templates/rh_docker.repo.j2 b/roles/docker/templates/rh_docker.repo.j2 index bc711d7fe..e783c0ddf 100644 --- a/roles/docker/templates/rh_docker.repo.j2 +++ b/roles/docker/templates/rh_docker.repo.j2 @@ -4,4 +4,4 @@ baseurl=https://yum.dockerproject.org/repo/main/centos/7 enabled=1 gpgcheck=1 gpgkey=https://yum.dockerproject.org/gpg -{% if http_proxy %}proxy={{ http_proxy }}{% endif %} +{% if http_proxy is defined %}proxy={{ http_proxy }}{% endif %}