ansible-debops-infrastructure

DebOps and Ansible scripts to manage my infrastructure
git clone git://git.erethon.com/ansible-debops-infrastructure
Log | Files | Refs

commit 1965386b39bff8ebf045e5837e5a0c2b41534fd9
parent d14badeb8322e95dc78018149bd2316c58ab7182
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Sun, 15 May 2022 20:18:36 +0300

productionmatrix: Backport cronjob to purge room

Diffstat:
ansible/inventory/host_vars/productionmatrix/cron.yml | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/ansible/inventory/host_vars/productionmatrix/cron.yml b/ansible/inventory/host_vars/productionmatrix/cron.yml @@ -5,5 +5,11 @@ cron__host_jobs: user: "root" jobs: - name: "Purge old Synapse media" - job: "curl --header 'Authorization: Bearer {{ synapse__admin_auth_token }}' -X POST localhost:8008/_synapse/admin/v1/purge_media_cache?before_ts=`date --date='-1 days' +\\%s\\%3N`" + job: "curl --header 'Authorization: Bearer {{ synapse__admin_auth_token }}' -X POST {{ ansible_host }}:8008/_synapse/admin/v1/purge_media_cache?before_ts=`date --date='-1 days' +\\%s\\%3N`" + special_time: "daily" + "cleanup_room_history": + user: "root" + jobs: + - name: "Delete events for room 1" + job: "curl --header 'Authorization: Bearer {{ synapse__admin_auth_token }}' -X POST -H 'Content-Type: application/json' {{ ansible_host }}:8008/_synapse/admin/v1/purge_history/{{ lookup('password', secret + '/credentials/productionmatrix/synapse/room_id_1') }} -d \"{\\\"delete_local_events\\\": true, \\\"purge_up_to_ts\\\": $(date --date='-10 days' +\\%s\\%3N)}\"" special_time: "daily"