ansible-debops-infrastructure

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

commit 7913fe0c75643c9e5a13206419ce6ead120cf16b
parent 0971a6fb200cc0ccc3884d24e9597bb3e4f83293
Author: Dionysis Grigoropoulos <dgrig@erethon.com>
Date:   Sun, 11 Oct 2020 01:01:59 +0300

productionmatrix: Add cronjob to purge old media

Diffstat:
ansible/inventory/host_vars/productionmatrix/cron.yml | 10++++++++++
ansible/inventory/host_vars/productionmatrix/element.yml | 2+-
ansible/inventory/host_vars/productionmatrix/synapse.yml | 2++
ansible/playbooks/synapse.yml | 8++++++--
4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ansible/inventory/host_vars/productionmatrix/cron.yml b/ansible/inventory/host_vars/productionmatrix/cron.yml @@ -0,0 +1,10 @@ +--- + +cron__host_jobs: + "purge_old_media": + 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 month' +\\%s\\%3N`" + special_time: "daily" + diff --git a/ansible/inventory/host_vars/productionmatrix/element.yml b/ansible/inventory/host_vars/productionmatrix/element.yml @@ -9,7 +9,7 @@ element__matrix_homeserver: "https://matrix.erethon.com" element__matrix_server_name: "erethon.com" -element__brand: "Erethon Riot" +element__brand: "Erethon Element" element__jitsi_url: "meet.libreops.cc" diff --git a/ansible/inventory/host_vars/productionmatrix/synapse.yml b/ansible/inventory/host_vars/productionmatrix/synapse.yml @@ -8,3 +8,5 @@ synapse__bind_addresses: ['0.0.0.0'] synapse__metrics_bind_addresses: ['0.0.0.0'] synapse__port: 8008 synapse__metrics_port: 9666 + +synapse__admin_auth_token: '{{ lookup("password", secret + "/credentials/productionmatrix/synapse/admin_auth_token") }}' diff --git a/ansible/playbooks/synapse.yml b/ansible/playbooks/synapse.yml @@ -10,11 +10,15 @@ roles: - - role: debops.secret + - role: secret - - role: debops.keyring + - role: cron + tags: [ 'role::cron', 'skip::cron' ] + + - role: keyring tags: [ 'role::keyring', 'skip::keyring', 'role::nginx' ] keyring__dependent_apt_keys: - '{{ synapse__keyring__dependent_apt_keys }}' - role: synapse + tags: [ 'role::synapse']