Loading tasks/cron.yaml +14 −1 Original line number Diff line number Diff line Loading @@ -8,5 +8,18 @@ owner: "root" group: "root" mode: "0644" when: 'type == "lxc"' when: - 'type == "lxc"' - "ansible_os_family == 'Debian'" tags: "cron" # configure cron - name: "cron - config - alpine" ansible.builtin.template: src: "templates/cron/alpine-root.j2" dest: "/etc/crontabs/root" owner: "root" group: "root" mode: "0600" when: "ansible_os_family == 'Alpine'" tags: "cron" tasks/main.yaml +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ # cron jobs - name: "cron jobs" ansible.builtin.import_tasks: "cron.yaml" when: "ansible_os_family == 'Debian'" tags: "cron" # swap Loading templates/cron/alpine-root.j2 0 → 100644 +10 −0 Original line number Diff line number Diff line # do daily/weekly/monthly maintenance # min hour day month weekday command */15 * * * * run-parts /etc/periodic/15min 0 * * * * run-parts /etc/periodic/hourly 0 2 * * * run-parts /etc/periodic/daily 0 3 * * 6 run-parts /etc/periodic/weekly 0 5 1 * * run-parts /etc/periodic/monthly # update packages between 3:15-3:30 am 15 3 * * * sleep $(($RANDOM % 900)) && apk -U upgrade >/dev/null 2>&1 && apk clean cache && reboot -d 60 Loading
tasks/cron.yaml +14 −1 Original line number Diff line number Diff line Loading @@ -8,5 +8,18 @@ owner: "root" group: "root" mode: "0644" when: 'type == "lxc"' when: - 'type == "lxc"' - "ansible_os_family == 'Debian'" tags: "cron" # configure cron - name: "cron - config - alpine" ansible.builtin.template: src: "templates/cron/alpine-root.j2" dest: "/etc/crontabs/root" owner: "root" group: "root" mode: "0600" when: "ansible_os_family == 'Alpine'" tags: "cron"
tasks/main.yaml +0 −1 Original line number Diff line number Diff line Loading @@ -31,7 +31,6 @@ # cron jobs - name: "cron jobs" ansible.builtin.import_tasks: "cron.yaml" when: "ansible_os_family == 'Debian'" tags: "cron" # swap Loading
templates/cron/alpine-root.j2 0 → 100644 +10 −0 Original line number Diff line number Diff line # do daily/weekly/monthly maintenance # min hour day month weekday command */15 * * * * run-parts /etc/periodic/15min 0 * * * * run-parts /etc/periodic/hourly 0 2 * * * run-parts /etc/periodic/daily 0 3 * * 6 run-parts /etc/periodic/weekly 0 5 1 * * run-parts /etc/periodic/monthly # update packages between 3:15-3:30 am 15 3 * * * sleep $(($RANDOM % 900)) && apk -U upgrade >/dev/null 2>&1 && apk clean cache && reboot -d 60