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 }}'