fix: Use internal healthcheck instead of HTTP ping endpoint
- Change health check to use docker exec traefik healthcheck - HTTP ping endpoint requires BasicAuth (401), internal check is more reliable - Improves health check accuracy in restart-traefik.yml playbook
This commit is contained in:
@@ -56,13 +56,10 @@
|
|||||||
changed_when: false
|
changed_when: false
|
||||||
failed_when: false
|
failed_when: false
|
||||||
|
|
||||||
- name: Check Traefik health endpoint
|
- name: Check Traefik health endpoint (ping endpoint requires auth, use internal check)
|
||||||
ansible.builtin.uri:
|
shell: |
|
||||||
url: "{{ traefik_url }}/ping"
|
cd {{ traefik_stack_path }}
|
||||||
method: GET
|
docker compose exec -T {{ traefik_container_name }} traefik healthcheck --ping 2>&1 || echo "HEALTH_CHECK_FAILED"
|
||||||
status_code: [200]
|
|
||||||
validate_certs: no
|
|
||||||
timeout: 10
|
|
||||||
register: traefik_health
|
register: traefik_health
|
||||||
ignore_errors: yes
|
ignore_errors: yes
|
||||||
changed_when: false
|
changed_when: false
|
||||||
|
|||||||
Reference in New Issue
Block a user