Skip to content

Commit

Permalink
Use debops.cron role to configure cron jobs
Browse files Browse the repository at this point in the history
Less dumb file copying, more intelligent configuring
  • Loading branch information
amedee committed Sep 23, 2024
1 parent 0282623 commit 33fdb10
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 25 deletions.
3 changes: 0 additions & 3 deletions roles/common/files/etc/cron.monthly/hadori

This file was deleted.

6 changes: 6 additions & 0 deletions roles/common/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,9 @@ dependencies:
- role: geerlingguy.swap
swap_file_size_mb: '4096'
- role: debops.debops.unattended_upgrades
- role: debops.debops.cron
cron__jobs:
hadori:
name: 'Hardlink with hadori'
special_time: 'monthly'
job: '/usr/bin/hadori --verbose /bin /sbin /lib /lib64 /usr /opt'
17 changes: 9 additions & 8 deletions roles/common/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,18 @@
mode: u=rw,go=r
notify: Restart munin-node

- name: Copy munin plugin config files
ansible.builtin.copy:
src: etc/munin/plugin-conf.d/
dest: /etc/munin/plugin-conf.d/
owner: root
mode: u=rw,go=r
directory_mode: u=rwx,go=rx
notify: Restart munin-node

- name: Allow access to port 4949
community.general.ufw:
rule: allow
port: 4949
src: 142.93.227.16
notify: Restart munin-node

- name: Copy etc files
ansible.builtin.copy:
src: etc/
dest: /etc/
owner: root
mode: u=rwx,go=rX
directory_mode: u=rwx,go=rx
6 changes: 0 additions & 6 deletions roles/mailinabox/files/etc/cron.daily/doveadm-expunge

This file was deleted.

19 changes: 19 additions & 0 deletions roles/mailinabox/meta/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,22 @@ dependencies:
version: '3.0.1'
priority: '99'
- role: mailserver
- role: debops.debops.cron
cron__jobs:
doveadm_expunge:
jobs:
- name: 'Expunge Trash'
special_time: 'daily'
job: '/usr/bin/expunge -A mailbox Trash before 30d'
- name: 'Expunge Spam'
special_time: 'daily'
job: '/usr/bin/expunge -A mailbox Spam before 60d'
extract_image_attachments:
name: 'Extract image attachments'
special_time: 'daily'
job: '/root/bin/extract_image_attachments.sh'
custom_files:
- src: 'root/bin/extract_image_attachments.sh'
dest: '/root/bin/extract_image_attachments.sh'
owner: root
mode: u=rwx,go=rx
16 changes: 8 additions & 8 deletions roles/mailinabox/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@
- /home/user-data/backup
- /home/user-data/dns

- name: Copy /etc/profile.d files
ansible.builtin.copy:
src: etc/profile.d/
dest: /etc/profile.d/
owner: root
mode: u=rwx,go=rx
directory_mode: u=rwx,go=rx

- name: Copy custom DNS settings
ansible.builtin.copy:
src: home/user-data/dns/custom.yaml
Expand All @@ -32,11 +40,3 @@

- name: Configure Munin
ansible.builtin.include_tasks: tasks/munin.yml

- name: Copy /etc files
ansible.builtin.copy:
src: etc/
dest: /etc/
owner: root
mode: u=rwX,go=rX
directory_mode: u=rwx,go=rx

0 comments on commit 33fdb10

Please sign in to comment.