chore(coolify): refactored coolify role

This commit is contained in:
ITQ
2026-02-22 15:16:30 +03:00
parent f2b8ee9d91
commit 69d019576b
6 changed files with 113 additions and 0 deletions
+20
View File
@@ -0,0 +1,20 @@
---
- name: Check if Coolify is installed (compose file exists)
ansible.builtin.stat:
path: "{{ coolify_base_dir }}/source/{{ coolify_compose_files[0] }}"
register: coolify_installed
tags: always
- name: Check Coolify container status
community.docker.docker_container_info:
name: "{{ item }}"
loop: "{{ coolify_container_names }}"
register: coolify_containers
when: coolify_installed.stat.exists
tags: always
- name: Set Coolify health fact
ansible.builtin.set_fact:
coolify_healthy: "{{ coolify_containers.results | selectattr('container', 'defined') | selectattr('container.State.Health.Status', 'defined') | selectattr('container.State.Health.Status', 'equalto', 'healthy') | list | length == coolify_container_names | length }}"
when: coolify_containers is defined and coolify_containers.results is defined
tags: always