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
|
||||
failed_when: false
|
||||
|
||||
- name: Check Traefik health endpoint
|
||||
ansible.builtin.uri:
|
||||
url: "{{ traefik_url }}/ping"
|
||||
method: GET
|
||||
status_code: [200]
|
||||
validate_certs: no
|
||||
timeout: 10
|
||||
- name: Check Traefik health endpoint (ping endpoint requires auth, use internal check)
|
||||
shell: |
|
||||
cd {{ traefik_stack_path }}
|
||||
docker compose exec -T {{ traefik_container_name }} traefik healthcheck --ping 2>&1 || echo "HEALTH_CHECK_FAILED"
|
||||
register: traefik_health
|
||||
ignore_errors: yes
|
||||
changed_when: false
|
||||
|
||||
Reference in New Issue
Block a user