Skip to content

Commit

Permalink
Add a weekly cron job to repack all databases
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisLovering committed Sep 13, 2024
1 parent 3c36609 commit fd756d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ansible/roles/postgres/tasks/pg_repack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,14 @@
tags:
- role::postgres
- role::postgres-pg_repack

- name: Add cronjob for mirror updating
cron:
name: "Run pg_repack on all databases"
special_time: "weekly"
job: "pg_repack -a"
user: "{{ postgres_user }}"
cron_file: "{{ postgres_pg_repack_cron_filename }}"
tags:
- role::postgres
- role::postgres-pg_repack
1 change: 1 addition & 0 deletions ansible/roles/postgres/vars/main/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
postgres_version: "15"
postgres_daemon: "postgresql@{{ postgres_version }}-main"
postgres_user: "postgres"
postgres_pg_repack_cron_filename: ansible_postgres_pg_repack

postgres_users:
- name: site
Expand Down

0 comments on commit fd756d3

Please sign in to comment.