diff --git a/roles/taskotron/taskotron-master/tasks/main.yml b/roles/taskotron/taskotron-master/tasks/main.yml index 55766dde33..7ed89205fd 100644 --- a/roles/taskotron/taskotron-master/tasks/main.yml +++ b/roles/taskotron/taskotron-master/tasks/main.yml @@ -18,8 +18,8 @@ - name: copy tmpwatch cronjob for taskotron artifacts and buildmaster template: src=taskotron-tmpwatch.cron.j2 dest=/etc/cron.d/taskotron-tmpwatch.cron owner=root group=root mode=0644 - when: deployment_type in ['stg', 'prod', 'local'] + when: deployment_type in ['prod', 'local'] -- name: copy tmpfiles.d for artifacts and buildmaster - template: src=tmpfiles.d.buildmaster.conf.j2 dest=/etc/tmpfiles.d/buildmaster.conf owner=root group=root mode=0644 - when: deployment_type in ['dev'] +- name: copy cronjob for cleaning old taskotron artifacts and buildmaster logs + template: src=taskotron-clean.cron.j2 dest=/etc/cron.d/taskotron-clean.cron owner=root group=root mode=0644 + when: deployment_type in ['dev', 'stg'] diff --git a/roles/taskotron/taskotron-master/templates/taskotron-clean.cron.j2 b/roles/taskotron/taskotron-master/templates/taskotron-clean.cron.j2 new file mode 100644 index 0000000000..c6f802c6ae --- /dev/null +++ b/roles/taskotron/taskotron-master/templates/taskotron-clean.cron.j2 @@ -0,0 +1,4 @@ +0 0 * * * {{ buildmaster_user }} find {{ public_artifacts_dir }} -type d -mtime +120 | xargs -r rm -rf +10 0 * * * {{ buildmaster_user }} find {{ buildmaster_dir }}/x86_64/ -type d -mtime +120 | xargs -r rm -rf +20 0 * * * {{ buildmaster_user }} find {{ buildmaster_dir }}/i386/ -type d -mtime +120 | xargs -r rm -rf +30 0 * * * {{ buildmaster_user }} find {{ buildmaster_dir }}/all/ -type d -mtime +120 | xargs -r rm -rf diff --git a/roles/taskotron/taskotron-master/templates/tmpfiles.d.buildmaster.conf.j2 b/roles/taskotron/taskotron-master/templates/tmpfiles.d.buildmaster.conf.j2 deleted file mode 100644 index e588b17a33..0000000000 --- a/roles/taskotron/taskotron-master/templates/tmpfiles.d.buildmaster.conf.j2 +++ /dev/null @@ -1,4 +0,0 @@ -d /srv/taskotron/artifacts 0775 buildmaster buildmaster 120d -d /srv/buildmaster/master/x86_64 0700 buildmaster buildmaster 120d -d /srv/buildmaster/master/i386 0700 buildmaster buildmaster 120d -d /srv/buildmaster/master/all 0700 buildmaster buildmaster 120d