From 309ab2caeee55ae1ff2cc096c8176d43ffe42c58 Mon Sep 17 00:00:00 2001 From: Gilad Peleg Date: Tue, 19 Sep 2017 11:19:58 +0300 Subject: [PATCH 1/9] Fix typo --- tasks/setup-Debian.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index d0be48d..bde6629 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -7,7 +7,7 @@ - docker - docker-engine -- name: Ensure depdencies are installed. +- name: Ensure dependencies are installed. apt: name: "{{ item }}" state: present From f3076bad559d2602ddf4163bbe3e33289ca4ec4f Mon Sep 17 00:00:00 2001 From: Pascal Armand Date: Mon, 27 Nov 2017 16:40:27 +0100 Subject: [PATCH 2/9] 'include' for tasks has been deprecated The use of 'include' for tasks has been deprecated. Use 'import_tasks' for static inclusions or 'include_tasks' for dynamic inclusions. --- tasks/main.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index ba197cf..d0bc72e 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -1,8 +1,8 @@ --- -- include: setup-RedHat.yml +- include_tasks: setup-RedHat.yml when: ansible_os_family == 'RedHat' -- include: setup-Debian.yml +- include_tasks: setup-Debian.yml when: ansible_os_family == 'Debian' - name: Install Docker. @@ -14,5 +14,5 @@ state: started enabled: yes -- include: docker-compose.yml +- include_tasks: docker-compose.yml when: docker_install_compose From b6f6b1b66cfcdfd272ed49160ece562fc714a8db Mon Sep 17 00:00:00 2001 From: Stephen Benjamin Date: Fri, 2 Feb 2018 10:54:16 -0500 Subject: [PATCH 3/9] Support fedora --- defaults/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3573df1..3ebf5a7 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,7 +13,7 @@ docker_compose_path: /usr/local/bin/docker-compose docker_apt_release_channel: stable docker_apt_repository: "deb https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" -# Used only for RedHat/CentOS. -docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo +# Used only for RedHat/CentOS/Fedora +docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora")|ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo docker_yum_repo_enable_edge: 0 docker_yum_repo_enable_test: 0 From 250660e149b2195c97957fca0cfaf16ed404be8e Mon Sep 17 00:00:00 2001 From: Dirk Weise Date: Thu, 22 Feb 2018 10:55:56 +0100 Subject: [PATCH 4/9] Make ignoring repository key error optional Just ignoring an error regarding the Docker GPG key and downloading it from "some" web page is not desired in any environment. Change-Id: I2d59e9bf070a4262ff5d251a65b698c858345eb7 --- defaults/main.yml | 1 + tasks/setup-Debian.yml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3573df1..94042d3 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -12,6 +12,7 @@ docker_compose_path: /usr/local/bin/docker-compose # Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed. docker_apt_release_channel: stable docker_apt_repository: "deb https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" +docker_apt_ignore_key_error: true # Used only for RedHat/CentOS. docker_yum_repo_url: https://download.docker.com/linux/centos/docker-{{ docker_edition }}.repo diff --git a/tasks/setup-Debian.yml b/tasks/setup-Debian.yml index d0be48d..87f8e4b 100644 --- a/tasks/setup-Debian.yml +++ b/tasks/setup-Debian.yml @@ -21,7 +21,7 @@ id: 9DC858229FC7DD38854AE2D88D81803C0EBFCD88 state: present register: add_repository_key - ignore_errors: true + ignore_errors: "{{ docker_apt_ignore_key_error }}" - name: Ensure curl is present (on older systems without SNI). package: name=curl state=present From 92b42b0352100908e06e36c9877dcaa075e7904b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 1 May 2018 19:15:19 -0500 Subject: [PATCH 5/9] Issue #54: Update Docker Compose default version to the latest version. --- README.md | 2 +- meta/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c7e81da..454f848 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,7 @@ Available variables are listed below, along with default values (see `defaults/m The `docker_edition` should be either `ce` (Community Edition) or `ee` (Enterprise Edition). You can also specify a specific version of Docker to install using a format like `docker-{{ docker_edition }}-`. And you can control whether the package is installed, uninstalled, or at the latest version by setting `docker_package_state` to `present`, `absent`, or `latest`, respectively. docker_install_compose: true - docker_compose_version: "1.16.1" + docker_compose_version: "1.21.1" docker_compose_path: /usr/local/bin/docker-compose Docker Compose installation options. diff --git a/meta/main.yml b/meta/main.yml index b975c01..575a466 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -6,7 +6,7 @@ galaxy_info: description: Docker for Linux. company: "Midwestern Mac, LLC" license: "license (BSD, MIT)" - min_ansible_version: 2.0 + min_ansible_version: 2.4 platforms: - name: EL versions: From fd8139c402c51f58ed3c91ae2497c15f85366203 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 1 May 2018 19:15:39 -0500 Subject: [PATCH 6/9] Issue #54: Update Docker Compose default version to the latest version. For real this time. --- defaults/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/defaults/main.yml b/defaults/main.yml index 3573df1..4d3d382 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -6,7 +6,7 @@ docker_package_state: present # Docker Compose options. docker_install_compose: true -docker_compose_version: "1.16.1" +docker_compose_version: "1.21.1" docker_compose_path: /usr/local/bin/docker-compose # Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed. From 07e05ef00f51b692d9ca1292967dbf36d393f7bf Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 1 May 2018 21:18:30 -0500 Subject: [PATCH 7/9] Fixes #21: DOCKER iptables chain problem when used with geerlingguy.firewall. --- README.md | 6 +++++- defaults/main.yml | 3 ++- tasks/main.yml | 9 ++++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 454f848..65b8a6e 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,11 @@ Available variables are listed below, along with default values (see `defaults/m The `docker_edition` should be either `ce` (Community Edition) or `ee` (Enterprise Edition). You can also specify a specific version of Docker to install using a format like `docker-{{ docker_edition }}-`. And you can control whether the package is installed, uninstalled, or at the latest version by setting `docker_package_state` to `present`, `absent`, or `latest`, respectively. - docker_install_compose: true + docker_restart_on_package_change: True + +Whether to restart the Docker daemon after the Docker package is installed or updated. If this is set to `True`, this role will flush all handlers (run any of the handlers that have been notified by this and any other role up to this point in the play). The default setting helps avoid firewall clashes with Docker rules (e.g. when using custom `iptables` rules or the `geerlingguy.firewall` Ansible role). + + docker_install_compose: True docker_compose_version: "1.21.1" docker_compose_path: /usr/local/bin/docker-compose diff --git a/defaults/main.yml b/defaults/main.yml index 4d3d382..88401df 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -3,9 +3,10 @@ docker_edition: 'ce' docker_package: "docker-{{ docker_edition }}" docker_package_state: present +docker_restart_on_package_change: True # Docker Compose options. -docker_install_compose: true +docker_install_compose: True docker_compose_version: "1.21.1" docker_compose_path: /usr/local/bin/docker-compose diff --git a/tasks/main.yml b/tasks/main.yml index d0bc72e..bbbc141 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -6,7 +6,10 @@ when: ansible_os_family == 'Debian' - name: Install Docker. - package: name={{ docker_package }} state={{ docker_package_state }} + package: + name: "{{ docker_package }}" + state: "{{ docker_package_state }}" + notify: restart docker - name: Ensure Docker is started and enabled at boot. service: @@ -14,5 +17,9 @@ state: started enabled: yes +- name: Ensure handlers are notified now to avoid firewall conflicts. + meta: flush_handlers + when: docker_restart_on_package_change + - include_tasks: docker-compose.yml when: docker_install_compose From 7b0f422f32e8aa0f5311d1d754e3e26b3f27952b Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 1 May 2018 21:31:35 -0500 Subject: [PATCH 8/9] PR #47 follow-up: Add tests for Ubuntu 18.04 Bionic, Fedora 27, and fix boolean case. --- .travis.yml | 5 +++-- README.md | 1 + defaults/main.yml | 6 +++--- meta/main.yml | 4 ++++ 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 25e8152..d371899 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,9 +3,10 @@ services: docker env: - distro: centos7 + - distro: ubuntu1804 - distro: ubuntu1604 - - distro: ubuntu1404 - - distro: debian8 + - distro: debian9 + - distro: fedora27 script: # Configure test script so we can run extra tests after playbook is run. diff --git a/README.md b/README.md index 65b8a6e..a420e8c 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,7 @@ Docker Compose installation options. docker_apt_release_channel: stable docker_apt_repository: "deb https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" + docker_apt_ignore_key_error: True (Used only for Debian/Ubuntu.) You can switch the channel to `edge` if you want to use the Edge release. diff --git a/defaults/main.yml b/defaults/main.yml index b6b754a..3448d79 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,9 +13,9 @@ docker_compose_path: /usr/local/bin/docker-compose # Used only for Debian/Ubuntu. Switch 'stable' to 'edge' if needed. docker_apt_release_channel: stable docker_apt_repository: "deb https://download.docker.com/linux/{{ ansible_distribution|lower }} {{ ansible_distribution_release }} {{ docker_apt_release_channel }}" -docker_apt_ignore_key_error: true +docker_apt_ignore_key_error: True -# Used only for RedHat/CentOS/Fedora -docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora")|ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo +# Used only for RedHat/CentOS/Fedora. +docker_yum_repo_url: https://download.docker.com/linux/{{ (ansible_distribution == "Fedora") | ternary("fedora","centos") }}/docker-{{ docker_edition }}.repo docker_yum_repo_enable_edge: 0 docker_yum_repo_enable_test: 0 diff --git a/meta/main.yml b/meta/main.yml index 575a466..939d881 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -12,6 +12,9 @@ galaxy_info: versions: - 6 - 7 + - name: Fedora + versions: + - all - name: Debian versions: - jessie @@ -19,6 +22,7 @@ galaxy_info: versions: - trusty - xenial + - bionic galaxy_tags: - web - system From 201cd7dd947541c3e1cc697fca41c42087524972 Mon Sep 17 00:00:00 2001 From: Jeff Geerling Date: Tue, 1 May 2018 21:36:08 -0500 Subject: [PATCH 9/9] Docker repo doesn't yet support Ubuntu 18.04 Bionic, it seems. --- .travis.yml | 2 +- meta/main.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index d371899..ea8dbd4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,8 +3,8 @@ services: docker env: - distro: centos7 - - distro: ubuntu1804 - distro: ubuntu1604 + - distro: ubuntu1404 - distro: debian9 - distro: fedora27 diff --git a/meta/main.yml b/meta/main.yml index 939d881..c872b5d 100644 --- a/meta/main.yml +++ b/meta/main.yml @@ -22,7 +22,6 @@ galaxy_info: versions: - trusty - xenial - - bionic galaxy_tags: - web - system