convert repo to ansible collection patrickj.docker_compose_app

This commit is contained in:
2026-07-16 21:43:52 -04:00
parent 1aff50b74e
commit 2d393ff46e
14 changed files with 458 additions and 411 deletions
+31
View File
@@ -0,0 +1,31 @@
---
- name: "{{ app_name }} - Update application"
block:
- name: Stop application for update
community.docker.docker_compose_v2:
project_src: "{{ app_dir }}"
state: stopped
- name: Pull latest container images
community.docker.docker_compose_v2:
project_src: "{{ app_dir }}"
pull: "{{ app_compose_pull | default('always') }}"
- name: Start application with new images
community.docker.docker_compose_v2:
project_src: "{{ app_dir }}"
state: present
recreate: always
register: update_restart
- name: Verify application health after update
ansible.builtin.include_tasks: health_check.yml
when: app_health_check | default(true)
rescue:
- name: Update failed, attempt to restart application
community.docker.docker_compose_v2:
project_src: "{{ app_dir }}"
state: present
tags: [update]