Update trusted domains for matomo

This commit is contained in:
2025-08-20 15:35:08 +02:00
parent f4a380d802
commit fa46523433
3 changed files with 8 additions and 3 deletions

View File

@@ -0,0 +1,42 @@
- name: "load docker, db and proxy for {{ application_id }}"
include_role:
name: cmp-db-docker-proxy
- name: "Patch Matomo config.ini.php"
include_tasks: 02_configuration.yml
- name: flush docker service
meta: flush_handlers
# Wait for API
- name: Exclude global IPs in Matomo
uri:
url: "{{ matomo_index_php_url }}"
method: POST
body_format: form-urlencoded
body:
module: API
method: SitesManager.setGlobalExcludedIps
excludedIps: "{{ matomo_excluded_ips | join(',') }}"
format: json
token_auth: "{{ matomo_auth_token }}"
return_content: yes
status_code: 200
register: matomo_exclude
until: matomo_exclude.status == 200
retries: 5
delay: 10
- name: Exclude CSP-CheckerBot user agent in Matomo
uri:
url: "{{ matomo_index_php_url }}"
method: POST
body_format: form-urlencoded
body:
module: API
method: SitesManager.setGlobalExcludedUserAgents
excludedUserAgents: "CSP-CheckerBot"
format: json
token_auth: "{{ matomo_auth_token }}"
return_content: yes
status_code: 200