From 8fdf8971921ef5ae1580a1fb5fbc229d92c37ba3 Mon Sep 17 00:00:00 2001 From: Grzegorz Dajuk Date: Fri, 17 Jul 2020 06:56:30 +0000 Subject: [PATCH 1/6] add docker_version variable support --- .../ansible/playbooks/roles/docker/defaults/main.yml | 6 +++++- .../common/ansible/playbooks/roles/docker/tasks/main.yml | 8 ++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml index 3ba1cf5165..d9d88d930b 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml @@ -4,4 +4,8 @@ docker_logging: max_file_size: 10m # The maximum size of the log before it is rolled. A positive integer plus a modifier representing the unit of measure (k, m, or g) max_files: 2 # The maximum number of log files that can be present -docker_version: 18.09.6 \ No newline at end of file +docker_version: "5:18.09.*" +docker_cli_version: "5:18.09.*" + +docker_version_rh: "3:18.09.*" +docker_cli_version_rh: "1:19.03.*" \ No newline at end of file diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml index eaea6119e9..84aab74441 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml @@ -9,8 +9,8 @@ - apt-transport-https - ca-certificates - containerd.io - - docker-ce-cli=5:18.09.* - - docker-ce=5:18.09.* + - docker-ce-cli={{ docker_cli_version }} + - docker-ce={{ docker_version }} when: ansible_os_family == "Debian" - name: Install Docker for RedHat family @@ -18,8 +18,8 @@ name: "{{ item }}" state: present loop: - - docker-ce-cli-18.09.* - - docker-ce-18.09.* + - docker-ce-cli-{{ docker_cli_version_rh }} + - docker-ce-{{ docker_version_rh }} when: ansible_os_family == "RedHat" - include_tasks: configure-docker.yml From ae8c13835ff86817070c246a04807a48ce2c3e2a Mon Sep 17 00:00:00 2001 From: Grzegorz Dajuk Date: Mon, 20 Jul 2020 11:29:20 +0000 Subject: [PATCH 2/6] Docker installation - 2 tasks merged into 1, to speed up the deployment --- .../playbooks/roles/docker/defaults/main.yml | 6 +--- .../playbooks/roles/docker/tasks/main.yml | 31 ++++++++----------- 2 files changed, 14 insertions(+), 23 deletions(-) diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml index d9d88d930b..b19e6e10dc 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml @@ -4,8 +4,4 @@ docker_logging: max_file_size: 10m # The maximum size of the log before it is rolled. A positive integer plus a modifier representing the unit of measure (k, m, or g) max_files: 2 # The maximum number of log files that can be present -docker_version: "5:18.09.*" -docker_cli_version: "5:18.09.*" - -docker_version_rh: "3:18.09.*" -docker_cli_version_rh: "1:19.03.*" \ No newline at end of file +docker_version: "18.09.*" \ No newline at end of file diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml index 84aab74441..468ac448c8 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml @@ -1,25 +1,20 @@ --- # Docker (used by master & worker as dependency) -- name: Install Docker for Debian family +- name: Install docker packages package: - name: "{{ item }}" + name: "{{ packages[ansible_os_family] }}" state: present - loop: - - apt-transport-https - - ca-certificates - - containerd.io - - docker-ce-cli={{ docker_cli_version }} - - docker-ce={{ docker_version }} - when: ansible_os_family == "Debian" - -- name: Install Docker for RedHat family - package: - name: "{{ item }}" - state: present - loop: - - docker-ce-cli-{{ docker_cli_version_rh }} - - docker-ce-{{ docker_version_rh }} - when: ansible_os_family == "RedHat" + vars: + packages: + RedHat: + - docker-ce-cli-{{ docker_version }} + - docker-ce-{{ docker_version }} + Debian: + - apt-transport-https + - ca-certificates + - containerd.io + - docker-ce-cli=5:{{ docker_version }} + - docker-ce=5:{{ docker_version }} - include_tasks: configure-docker.yml From 2ced26faa0bc9a0cc4db833ea736bdb4b1375b8c Mon Sep 17 00:00:00 2001 From: Grzegorz Dajuk Date: Wed, 22 Jul 2020 12:26:37 +0200 Subject: [PATCH 3/6] Testing docker variables adjustments --- .../ansible/playbooks/roles/docker/defaults/main.yml | 4 +++- .../common/ansible/playbooks/roles/docker/tasks/main.yml | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml index b19e6e10dc..13c42b243a 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/defaults/main.yml @@ -4,4 +4,6 @@ docker_logging: max_file_size: 10m # The maximum size of the log before it is rolled. A positive integer plus a modifier representing the unit of measure (k, m, or g) max_files: 2 # The maximum number of log files that can be present -docker_version: "18.09.*" \ No newline at end of file +docker_version: + Debian: "5:18.09.*" + RedHat: "18.09.*" \ No newline at end of file diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml index 468ac448c8..2f4256d1bd 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml @@ -8,13 +8,13 @@ vars: packages: RedHat: - - docker-ce-cli-{{ docker_version }} - - docker-ce-{{ docker_version }} + - docker-ce-cli-{{ docker_version.RedHat }} + - docker-ce-{{ docker_version.RedHat }} Debian: - apt-transport-https - ca-certificates - containerd.io - - docker-ce-cli=5:{{ docker_version }} - - docker-ce=5:{{ docker_version }} + - docker-ce-cli={{ docker_version.Debian }} + - docker-ce={{ docker_version.Debian }} - include_tasks: configure-docker.yml From 74e477712980ec3695b2e5bed461e77a67d02e79 Mon Sep 17 00:00:00 2001 From: Grzegorz Dajuk Date: Wed, 22 Jul 2020 12:53:03 +0200 Subject: [PATCH 4/6] Remove two usless packages from docker installation --- .../data/common/ansible/playbooks/roles/docker/tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml index 2f4256d1bd..6d9fdf432f 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml @@ -11,8 +11,6 @@ - docker-ce-cli-{{ docker_version.RedHat }} - docker-ce-{{ docker_version.RedHat }} Debian: - - apt-transport-https - - ca-certificates - containerd.io - docker-ce-cli={{ docker_version.Debian }} - docker-ce={{ docker_version.Debian }} From 25e2c9abd7bdfc05aee487c210197b5fea43a6b2 Mon Sep 17 00:00:00 2001 From: Grzegorz Dajuk Date: Wed, 22 Jul 2020 15:06:11 +0200 Subject: [PATCH 5/6] Space char removed to provide proper yaml syntax --- .../data/common/ansible/playbooks/roles/docker/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml index 6d9fdf432f..080c61d08a 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml @@ -1,7 +1,7 @@ --- # Docker (used by master & worker as dependency) -- name: Install docker packages +- name: Install docker packages package: name: "{{ packages[ansible_os_family] }}" state: present From 3a71db1fe4cc2d91fad18b993e58e1ca611296a9 Mon Sep 17 00:00:00 2001 From: Grzegorz Dajuk Date: Wed, 22 Jul 2020 15:21:10 +0200 Subject: [PATCH 6/6] Cosmetic fix --- .../data/common/ansible/playbooks/roles/docker/tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml index 080c61d08a..245e488f13 100644 --- a/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml +++ b/core/src/epicli/data/common/ansible/playbooks/roles/docker/tasks/main.yml @@ -1,7 +1,7 @@ --- # Docker (used by master & worker as dependency) -- name: Install docker packages +- name: Install Docker packages package: name: "{{ packages[ansible_os_family] }}" state: present