summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiroslav Suchý <msuchy@redhat.com>2017-04-27 20:50:50 +0200
committerMiroslav Suchý <msuchy@redhat.com>2017-04-27 20:51:05 +0200
commitd0fd02b229cd66d46fc3fa99e0814c3ec1664df5 (patch)
treeb47570dc80723d10e9c87615cc8b4e007caa3c02
parent76f8efcbd36c595e19a1fbcb4ca75ba779b31b30 (diff)
downloadansible-d0fd02b229cd66d46fc3fa99e0814c3ec1664df5.tar.gz
ansible-d0fd02b229cd66d46fc3fa99e0814c3ec1664df5.tar.xz
ansible-d0fd02b229cd66d46fc3fa99e0814c3ec1664df5.zip
retrace: add some local cron jobs
-rw-r--r--roles/abrt/faf-local/tasks/cron.yml63
-rw-r--r--roles/abrt/faf-local/tasks/main.yml3
2 files changed, 66 insertions, 0 deletions
diff --git a/roles/abrt/faf-local/tasks/cron.yml b/roles/abrt/faf-local/tasks/cron.yml
new file mode 100644
index 000000000..d7f2f1417
--- /dev/null
+++ b/roles/abrt/faf-local/tasks/cron.yml
@@ -0,0 +1,63 @@
+---
+
+- name: cron for faf reposync
+ cron:
+ name: "cron for faf reposync {{ item.repos }}"
+ user: faf
+ job: "faf reposync -d {{ item.repos }} >> /var/log/faf/{{ item.log }} 2>&1"
+ special_time: daily
+ state: present
+ when: not devel
+ with_items:
+ # rawhide
+ - { log: "reposync-fedora-rawhide.log", repos: "fedora-rawhide-source fedora-rawhide-x86_64 fedora-rawhide-x86_64-debug fedora-rawhide-i386 fedora-rawhide-i386-debug fedora-rawhide-armhfp fedora-rawhide-armhfp-debug" }
+ # Fedora 24
+ - { log: "reposync-fedora-24.log", repos: "fedora-24-source fedora-24-x86_64 fedora-24-x86_64-debug fedora-24-i386 fedora-24-i386-debug fedora-24-armhfp fedora-24-armhfp-debug" }
+ - { log: "reposync-fedora-24-updates.log", repos: "fedora-24-updates-source fedora-24-x86_64-updates fedora-24-x86_64-updates-debug fedora-24-i386-updates fedora-24-i386-updates-debug fedora-24-armhfp-updates fedora-24-armhfp-updates-debug" }
+ - { log: "reposync-fedora-24-testing.log", repos: "fedora-24-testing-source fedora-24-x86_64-testing fedora-24-x86_64-testing-debug fedora-24-i386-testing fedora-24-i386-testing-debug fedora-24-armhfp-testing fedora-24-armhfp-testing-debug" }
+ - { log: "reposync-fedora-24-kernel-rt.log", repos: "fedora-24-x86_64-kernel-rt fedora-24-x86_64-kernel-rt-testing fedora-24-i386-kernel-rt fedora-24-i386-kernel-rt-testing" }
+ # Fedora 25
+ - { log: "reposync-fedora-25.log", repos: "fedora-25-source fedora-25-x86_64 fedora-25-x86_64-debug fedora-25-i386 fedora-25-i386-debug fedora-25-armhfp fedora-25-armhfp-debug" }
+ - { log: "reposync-fedora-25-updates.log", repos: "fedora-25-updates-source fedora-25-x86_64-updates fedora-25-x86_64-updates-debug fedora-25-i386-updates fedora-25-i386-updates-debug fedora-25-armhfp-updates fedora-25-armhfp-updates-debug" }
+ - { log: "reposync-fedora-25-testing.log", repos: "fedora-25-testing-source fedora-25-x86_64-testing fedora-25-x86_64-testing-debug fedora-25-i386-testing fedora-25-i386-testing-debug fedora-25-armhfp-testing fedora-25-armhfp-testing-debug" }
+ - { log: "reposync-fedora-25-kernel-rt.log", repos: "fedora-25-x86_64-kernel-rt fedora-25-x86_64-kernel-rt-testing fedora-25-i386-kernel-rt fedora-25-i386-kernel-rt-testing" }
+ # Fedora 26
+ - { log: "reposync-fedora-26.log", repos: "fedora-26-source fedora-26-x86_64 fedora-26-x86_64-debug fedora-26-i386 fedora-26-i386-debug fedora-26-armhfp fedora-26-armhfp-debug"}
+ - { log: "reposync-fedora-26-updates.log", repos: "fedora-26-updates-source fedora-26-x86_64-updates fedora-26-x86_64-updates-debug fedora-26-i386-updates fedora-26-i386-updates-debug fedora-26-armhfp-updates fedora-26-armhfp-updates-debug" }
+ - { log: "reposync-fedora-26-testing.log", repos: "fedora-26-testing-source fedora-26-x86_64-testing fedora-26-x86_64-testing-debug fedora-26-i386-testing fedora-26-i386-testing-debug fedora-26-armhfp-testing fedora-26-armhfp-testing-debug" }
+ - { log: "reposync-fedora-26-kernel-rt.log", repos: "fedora-26-x86_64-kernel-rt fedora-26-x86_64-kernel-rt-testing fedora-26-i386-kernel-rt fedora-26-i386-kernel-rt-testing" }
+ # Centos
+ - { log: "reposync-centos-7.log", repos: "centos-7-x86_64 centos-7-x86_64-updates centos-7-x86_64-centosplus centos-7-x86_64-extras centos-7-x86_64-fasttrack centos-7-i386-debug centos-7-x86_64-debug" }
+ - { log: "reposync-epel-7.log", repos: "epel-7-x86_64 epel-7-x86_64-debug" }
+
+- name: backup database
+ cron:
+ name: "backup database"
+ user: faf
+ job: "( pg_dump -Fc faf > /srv/faf/db-backup/backup-$(date '+\%F').dump ) >> /var/log/faf/db_backup.log 2>&1"
+ special_time: daily
+ state: present
+
+- name: match unknown packages
+ cron:
+ name: "match unknown packages"
+ user: faf
+ job: "faf match-unknown-packages -d >> /var/log/faf/match-unknown-packages.log 2>&1"
+ special_time: daily
+ state: present
+
+- name: pull releases, components and associates
+ cron:
+ name: "cron for {{ item.what }} {{ item.distro }}"
+ user: faf
+ job: "faf {{ item.what }} -o {{ item.distro }} -d >> /var/log/faf/{{ item.what }}-{{ item.distro }}.log 2>&1"
+ special_time: daily
+ state: present
+ when: not devel
+ with_items:
+ - { what: "pull-releases", distro: "fedora" }
+ - { what: "pull-components", distro: "fedora" }
+ - { what: "find-components", distro: "fedora" }
+ - { what: "pull-releases", distro: "centos" }
+ - { what: "pull-components", distro: "centos" }
+ - { what: "find-components", distro: "centos" }
diff --git a/roles/abrt/faf-local/tasks/main.yml b/roles/abrt/faf-local/tasks/main.yml
index ae73ec286..f7ff81ea9 100644
--- a/roles/abrt/faf-local/tasks/main.yml
+++ b/roles/abrt/faf-local/tasks/main.yml
@@ -60,3 +60,6 @@
regexp: 'MORE_SATYR ='
line: ' MORE_SATYR = "https://github.com/abrt/satyr/"'
notify: restart httpd
+
+- include: cron.yml
+ tags: cron