From 6956ce1c900e88839c470075bd8e02f256e87db3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Soko=C5=82owski?= Date: Thu, 1 Aug 2024 17:08:02 +0200 Subject: [PATCH] docker: upgrade to Docker Compose V2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakub SokoĊ‚owski --- defaults/main.yml | 4 ++-- tasks/docker.yml | 10 ++++------ templates/docker-compose.yml.j2 | 1 - 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/defaults/main.yml b/defaults/main.yml index b788629..a39a381 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -52,7 +52,7 @@ grafana_plugins: [] grafana_unsigned_plugins: [] # - https://github.com/GoshPosh/grafana-meta-queries/archive/0.0.3.zip -# Generic container options -compose_recreate: 'smart' +# general container management compose_state: 'present' +compose_recreate: 'smart' compose_restart: false diff --git a/tasks/docker.yml b/tasks/docker.yml index aa33259..ca65793 100644 --- a/tasks/docker.yml +++ b/tasks/docker.yml @@ -8,10 +8,8 @@ mode: 0640 - name: Create containers - docker_compose: + community.docker.docker_compose_v2: project_src: '{{ grafana_service_path }}' - pull: true - build: false - state: '{{ compose_state }}' - restarted: '{{ compose_restart }}' - recreate: '{{ grafana_config.changed | ternary("always", compose_recreate) }}' + pull: '{{ compose_pull }}' + state: '{{ compose_state }}' + recreate: '{{ grafana_config.changed | ternary("always", compose_recreate) }}' diff --git a/templates/docker-compose.yml.j2 b/templates/docker-compose.yml.j2 index 8185256..adb5111 100644 --- a/templates/docker-compose.yml.j2 +++ b/templates/docker-compose.yml.j2 @@ -1,5 +1,4 @@ --- -version: '3.7' services: app: container_name: '{{ grafana_cont_name }}'