diff --git a/roles/koschei/files/cron-db-cleanup b/roles/koschei/files/cron-db-cleanup deleted file mode 100644 index 4b0b794305..0000000000 --- a/roles/koschei/files/cron-db-cleanup +++ /dev/null @@ -1 +0,0 @@ -0 4 * * * koschei koschei-admin cleanup --older-than 6 diff --git a/roles/koschei/tasks/main.yml b/roles/koschei/tasks/main.yml index 7b735ab1bf..62a3f4fda8 100644 --- a/roles/koschei/tasks/main.yml +++ b/roles/koschei/tasks/main.yml @@ -103,9 +103,7 @@ - selinux - name: Copy the cleanup cronjob - copy: src="{{item}}" dest="/etc/cron.d/{{item}}" - with_items: - - cron-db-cleanup + template: src=cron-db-cleanup.j2 dest=/etc/cron.d/cron-db-cleanup tags: - koschei diff --git a/roles/koschei/templates/cron-db-cleanup.j2 b/roles/koschei/templates/cron-db-cleanup.j2 new file mode 100644 index 0000000000..32fdf5fd58 --- /dev/null +++ b/roles/koschei/templates/cron-db-cleanup.j2 @@ -0,0 +1,2 @@ +0 3 * * * koschei koschei-admin cleanup --older-than 6 +0 4 * * * koschei psql -h {{ koschei_pgsql_hostname }} -d koschei -U koscheiadmin -c 'VACUUM FULL ANALYZE package;'