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 }}'
# general container management
compose_recreate: 'smart'
compose_recreate: 'auto'
compose_state: 'present'
compose_restart: false
compose_pull: 'always'

View File

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

View File

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