From ce524f01229e9b44d542be92085d15e2ee18d6ce Mon Sep 17 00:00:00 2001 From: Christian Lang Date: Mon, 13 Mar 2023 14:56:09 +0100 Subject: [PATCH] * replace docker compose V1 by new V2 docker plugin --- ansible/roles/docker/defaults/main.yml | 2 ++ ansible/roles/docker/tasks/main.yml | 15 ++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ansible/roles/docker/defaults/main.yml b/ansible/roles/docker/defaults/main.yml index f8c93bb..2a7e1fc 100644 --- a/ansible/roles/docker/defaults/main.yml +++ b/ansible/roles/docker/defaults/main.yml @@ -1,3 +1,5 @@ --- docker_daemon_config_folder: "/etc/docker" +docker_plugins_folder: "/usr/lib/docker/cli-plugins" +docker_compose_url: "https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64" diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml index 85b5cdb..c0a64be 100644 --- a/ansible/roles/docker/tasks/main.yml +++ b/ansible/roles/docker/tasks/main.yml @@ -9,7 +9,6 @@ - curl - software-properties-common - docker.io - - docker-compose - name: Create group docker become: true @@ -23,6 +22,20 @@ append: true groups: docker +- name: "Create docker plugins folder: {{ docker_plugins_folder }}" + become: true + ansible.builtin.file: + dest: "{{ docker_plugins_folder }}" + state: directory + mode: "755" + +- name: "Install docker compose V2 plugin" + become: true + ansible.builtin.get_url: + url: "{{ docker_compose_url }}" + dest: "{{ docker_plugins_folder }}/docker-compose" + mode: "755" + - name: "Add docker daemon network config: {{ docker_daemon_config_folder }}/daemon.json" become: true ansible.builtin.copy: