From a4896cac336500c37a83c917b105fb9b1043c97a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 20:31:24 +0200 Subject: [PATCH 1/8] install the docker compose plugin --- tasks/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/tasks/main.yml b/tasks/main.yml index 5bcc27a..0fc75b6 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -31,6 +31,7 @@ - docker-ce - docker-ce-cli - containerd.io + - docker-compose-plugin state: present - name: Configure docker daemon From 03a6c15cbd69c944b4703e5f4cf6ee3bfad7d7e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 20:47:25 +0200 Subject: [PATCH 2/8] make the deb repo autoconfigure aka use the ansible_distribution and ansible_distribution_release vars --- tasks/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 0fc75b6..53cdd5a 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -18,7 +18,7 @@ - name: Ensure docker repository is available apt_repository: - repo: deb https://download.docker.com/linux/debian buster stable + repo: deb https://download.docker.com/linux/{{ ansible_distribution | lower }} {{ ansible_distribution_release }} stable state: present notify: Update apt cache From 74c55d148498678f3820a2f289b213a391370fd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 20:57:41 +0200 Subject: [PATCH 3/8] add an empty meta file to make ansible-galaxy happy --- meta/main.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 meta/main.yml diff --git a/meta/main.yml b/meta/main.yml new file mode 100644 index 0000000..b32a44c --- /dev/null +++ b/meta/main.yml @@ -0,0 +1,2 @@ +--- +galaxy_info: From 019079e7dd5f84898c545124fa7fef3e982d55cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 21:49:49 +0200 Subject: [PATCH 4/8] add defaults to circumvent problems while running without explicit set vars --- defaults/main.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 defaults/main.yml diff --git a/defaults/main.yml b/defaults/main.yml new file mode 100644 index 0000000..280261c --- /dev/null +++ b/defaults/main.yml @@ -0,0 +1,2 @@ +docker_swarm_worker: false +docker_swarm_manager: false \ No newline at end of file From 7b1d20c9cdb915f9a57f3c50d8e8522f5cb6501a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 21:57:08 +0200 Subject: [PATCH 5/8] nfs-common is not needed in the scope of this role --- tasks/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/tasks/main.yml b/tasks/main.yml index 53cdd5a..ace1dd4 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -8,7 +8,6 @@ - curl - gnupg-agent - software-properties-common - - nfs-common state: present - name: Trust dockers GPG key From c83339b40822a4ac8526f9a344b56936fbb9a01e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 21:59:44 +0200 Subject: [PATCH 6/8] remove the advertide address as it shouldn't be needed --- tasks/main.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index ace1dd4..94b28f5 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -60,7 +60,6 @@ - name: Join swarm as manager docker_swarm: state: join - advertise_addr: "{{ ansible_default_ipv4.address }}" join_token: "{{ docker_swarm_join_token_manager }}" remote_addrs: ['192.168.168.200:2377'] when: docker_swarm_manager @@ -68,7 +67,6 @@ - name: Join swarm as worker docker_swarm: state: join - advertise_addr: "{{ ansible_default_ipv4.address }}" join_token: "{{ docker_swarm_join_token_worker }}" remote_addrs: ['192.168.168.200:2377'] when: not docker_swarm_manager From e38743e004739278e59540e0dd276aec31513c8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 22:05:51 +0200 Subject: [PATCH 7/8] make the swarm address configurable --- tasks/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 94b28f5..07ab43f 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -61,12 +61,12 @@ docker_swarm: state: join join_token: "{{ docker_swarm_join_token_manager }}" - remote_addrs: ['192.168.168.200:2377'] + remote_addrs: ["{{ docker_swarm_address }}"] when: docker_swarm_manager - name: Join swarm as worker docker_swarm: state: join join_token: "{{ docker_swarm_join_token_worker }}" - remote_addrs: ['192.168.168.200:2377'] + remote_addrs: ["{{ docker_swarm_address }}"] when: not docker_swarm_manager From c1776ffb7931193cac46669291fccd77d8844dcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Mon, 19 Sep 2022 22:06:35 +0200 Subject: [PATCH 8/8] remove commented out of scope task --- tasks/main.yml | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/tasks/main.yml b/tasks/main.yml index 07ab43f..4a1569c 100644 --- a/tasks/main.yml +++ b/tasks/main.yml @@ -41,16 +41,6 @@ group: root mode: 0644 -#- hosts: swarm:!NAS -# tasks: -# - name: Mount NFS -# mount: -# path: /mnt/nfs -# src: grace.lan:/ -# fstype: nfs4 -# opts: rw,nosuid,fsc -# state: mounted - - name: Install docker python module pip: executable: pip3