mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2025-12-08 18:35:11 +00:00
Refactor reachability checks for Matomo and Mailu
- Replace status_code [200,301,302] with explicit 'status_code: 200' - Use '(status | default(0) | int) != 200' for consistent reachability detection - Remove deprecated Jinja usage inside when-conditions - Replace string-rendered conditions with native boolean checks - Improve Mailu routine trigger logic by tightening status evaluation - Cleanup unused no_log directives Reference: https://chatgpt.com/share/692f04b5-5698-800f-a355-9e9b70cf97d7
This commit is contained in:
@@ -5,11 +5,10 @@
|
||||
url: "{{ domains | get_url('web-app-matomo', WEB_PROTOCOL) }}"
|
||||
method: HEAD
|
||||
validate_certs: yes
|
||||
status_code: [200, 301, 302]
|
||||
status_code: 200
|
||||
register: matomo_reachability
|
||||
failed_when: false
|
||||
changed_when: false
|
||||
no_log: "{{ MASK_CREDENTIALS_IN_LOGS | bool }}"
|
||||
when:
|
||||
- application_id != 'web-app-matomo'
|
||||
- run_once_web_app_matomo is not defined
|
||||
@@ -20,7 +19,7 @@
|
||||
public: false
|
||||
when:
|
||||
- matomo_reachability is defined
|
||||
- matomo_reachability.status | default(0) not in [200, 301, 302]
|
||||
- (matomo_reachability.status | default(0) | int) != 200
|
||||
|
||||
# Matomo can't use this dependencies - At least not on the initial setup run
|
||||
- when:
|
||||
|
||||
Reference in New Issue
Block a user