mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-08-29 15:06:26 +02:00
Added logic to start docker compose pull just once per directory
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
- name: docker compose pull
|
||||
shell: |
|
||||
set -euo pipefail
|
||||
lock="/run/ansible/compose-pull/{{ docker_compose.directories.instance | hash('sha1') }}"
|
||||
lock="{{ [ PATH_DOCKER_COMPOSE_PULL_LOCK_DIR | docker_compose.directories.instance ] path_join | hash('sha1') }}"
|
||||
if [ ! -e "$lock" ]; then
|
||||
mkdir -p "$(dirname "$lock")"
|
||||
docker compose pull
|
||||
@@ -29,7 +29,7 @@
|
||||
environment:
|
||||
COMPOSE_HTTP_TIMEOUT: 600
|
||||
DOCKER_CLIENT_TIMEOUT: 600
|
||||
when: (MODE_UPDATE | bool
|
||||
when: MODE_UPDATE | bool
|
||||
listen:
|
||||
- docker compose up
|
||||
- docker compose restart
|
||||
|
@@ -1,3 +1,8 @@
|
||||
- name: Remove all docker compose pull locks
|
||||
file:
|
||||
path: "{{ PATH_DOCKER_COMPOSE_PULL_LOCK_DIR }}"
|
||||
state: absent
|
||||
|
||||
- name: "Load docker container role"
|
||||
include_role:
|
||||
name: docker-container
|
||||
|
Reference in New Issue
Block a user