From 89bbe92e54960eeae7867fb28f057cb7bc760864 Mon Sep 17 00:00:00 2001 From: Jakob Meier Date: Fri, 3 Nov 2023 08:24:18 +0100 Subject: [PATCH] Added cron service for meta and git --- roles/git.sr.ht/tasks/main.yml | 5 +++++ roles/meta.sr.ht/tasks/main.yml | 5 +++++ roles/sr.ht-core/tasks/main.yml | 6 ++++++ roles/sr.ht-core/tasks/packages.yml | 6 ------ 4 files changed, 16 insertions(+), 6 deletions(-) diff --git a/roles/git.sr.ht/tasks/main.yml b/roles/git.sr.ht/tasks/main.yml index d67f61c..a424402 100644 --- a/roles/git.sr.ht/tasks/main.yml +++ b/roles/git.sr.ht/tasks/main.yml @@ -24,3 +24,8 @@ - name: Setup nginx ansible.builtin.import_tasks: nginx.yml + +- name: Enable periodic cron service + ansible.builtin.lineinfile: + path: /etc/crontabs/root + line: "*/20 * * * * gitsrht-periodic" diff --git a/roles/meta.sr.ht/tasks/main.yml b/roles/meta.sr.ht/tasks/main.yml index 6fc4cf8..0236e25 100644 --- a/roles/meta.sr.ht/tasks/main.yml +++ b/roles/meta.sr.ht/tasks/main.yml @@ -18,3 +18,8 @@ - name: Setup nginx ansible.builtin.import_tasks: nginx.yml + +- name: Enable periodic cron service + ansible.builtin.lineinfile: + path: /etc/crontabs/root + line: "0 2 * * * metasrht-daily" diff --git a/roles/sr.ht-core/tasks/main.yml b/roles/sr.ht-core/tasks/main.yml index 53c057f..a815120 100644 --- a/roles/sr.ht-core/tasks/main.yml +++ b/roles/sr.ht-core/tasks/main.yml @@ -5,3 +5,9 @@ ansible.builtin.import_tasks: db.yml - name: Copy config file ansible.builtin.import_tasks: config.yml + +# uses the builtin busybox crond daemon by default +- name: Enable & start cron daemon + ansible.builtin.service: + name: crond + state: started diff --git a/roles/sr.ht-core/tasks/packages.yml b/roles/sr.ht-core/tasks/packages.yml index 27fd0f3..3e413ff 100644 --- a/roles/sr.ht-core/tasks/packages.yml +++ b/roles/sr.ht-core/tasks/packages.yml @@ -6,12 +6,6 @@ - redis state: latest -- name: Install chron daemon - community.general.apk: - name: - - chrony - state: latest - - name: Add sourcehut repos ansible.builtin.lineinfile: path: /etc/apk/repositories -- 2.38.5