From 88ce0d4dd4809878fddce4ce3131c87b221d05e2 Mon Sep 17 00:00:00 2001 From: Benoit Carriere Date: Fri, 20 May 2016 14:21:45 -0400 Subject: [PATCH 1/2] Add option to install or not yum repo. --- defaults/main.yml | 2 ++ tasks/RedHat.yml | 1 + 2 files changed, 3 insertions(+) diff --git a/defaults/main.yml b/defaults/main.yml index 847babd..e18aea2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,6 +13,8 @@ docker_yum_repo_url: "https://yum.dockerproject.org/repo/main" docker_yum_repo: "{{ docker_yum_repo_url }}/{{ docker_yum_repo_uris[ansible_distribution] }}" docker_yum_repo_gpg: 'https://yum.dockerproject.org/gpg' docker_yum_package: "docker-engine{{ '-' + docker_version if docker_version else '' }}" +# Optionally install yum repo file +docker_yum_install_repo: yes # Prior to 1.9, starting Docker engine as daemon use flag '-d' was used, now it's 'daemon' argument docker_daemon_opts: "{{ 'daemon' if docker_version == '' or docker_version | version_compare('1.9', '>=') else '-d' }}{{ ' -H fd://' if ansible_os_family == 'RedHat' else ''}}" diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 2010eec..6e6a1ef 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -1,6 +1,7 @@ - name: Install Docker Repository template: src=docker-repo.j2 dest=/etc/yum.repos.d/docker.repo + when: docker_yum_install_repo == yes - name: (yum) Install SELinux python bindings yum: name=libselinux-python state=present From 56c7bdbee930ccc5c8cb01d5d1af9448d2bb5d6f Mon Sep 17 00:00:00 2001 From: Benoit Carriere Date: Thu, 28 Jul 2016 22:32:46 -0400 Subject: [PATCH 2/2] Fix condition evaluation failing. --- tasks/RedHat.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/RedHat.yml b/tasks/RedHat.yml index 6e6a1ef..6d1d0fe 100644 --- a/tasks/RedHat.yml +++ b/tasks/RedHat.yml @@ -1,7 +1,7 @@ - name: Install Docker Repository template: src=docker-repo.j2 dest=/etc/yum.repos.d/docker.repo - when: docker_yum_install_repo == yes + when: docker_yum_install_repo - name: (yum) Install SELinux python bindings yum: name=libselinux-python state=present