commit 4b1eb480cad619748d1353611be97c0d8d9cf460
parent b4870f996a6237573d5e94f1d0e4d12e2d0a10fd
Author: Karl Eklund <localpart@gmail.com>
Date: Sat, 28 Mar 2026 14:23:41 +0100
Restart the container if the image has changed
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/playbook.yml b/playbook.yml
@@ -6,14 +6,17 @@
name: service-status-app
state: present
source: build
+ force_source: true
build:
path: "{{ playbook_dir }}/python_app"
rm: true
tag: latest
+ register: build_result
- name: Run Docker container
docker_container:
name: service-status-app
image: service-status-app:latest
state: started
+ recreate: "{{ build_result.changed }}"
ports:
- "8000:8000"