docker: use docker_compose_v2 module

https://docs.ansible.com/ansible/latest/collections/community/docker/docker_compose_v2_module.html

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2024-07-06 10:14:07 +02:00
parent 1bb46448dc
commit e266840902
No known key found for this signature in database
GPG Key ID: FE65CD384D5BF7B4
3 changed files with 7 additions and 10 deletions

View File

@ -133,6 +133,6 @@ geth_cont_mem_ratio: 0.6
geth_cont_mem_limit: '{{ (ansible_memtotal_mb * geth_cont_mem_ratio|float) | int }}' geth_cont_mem_limit: '{{ (ansible_memtotal_mb * geth_cont_mem_ratio|float) | int }}'
# general container management # general container management
compose_recreate: 'smart' compose_recreate: 'auto'
compose_state: 'present' compose_state: 'present'
compose_restart: false compose_pull: 'always'

View File

@ -16,11 +16,9 @@
register: geth_all_compose register: geth_all_compose
- name: Geth | Create containers - name: Geth | Create containers
docker_compose: community.docker.docker_compose_v2:
project_src: '{{ geth_service_path }}' project_src: '{{ geth_service_path }}'
files: '{{ geth_all_compose.files | map(attribute="path") | list }}' files: '{{ geth_all_compose.files | map(attribute="path") | list }}'
state: '{{ compose_state }}' state: '{{ compose_state }}'
restarted: '{{ compose_restart }}' recreate: '{{ compose_recreate }}'
recreate: '{{ compose_recreate | default("smart") }}' pull: '{{ compose_pull }}'
pull: true
build: false

View File

@ -1,5 +1,4 @@
--- ---
version: '3.7'
services: services:
geth: geth:
container_name: '{{ geth_cont_name }}' container_name: '{{ geth_cont_name }}'