summaryrefslogtreecommitdiffstats
path: root/roles/backup/tasks/openrc.yml
blob: 12ea9686d0f8b07210ec10cb6cde4bfb15c9ed45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
---
- name: "Deploy backup script"
  become: true
  ansible.builtin.template:
    src: "backup-openrc.sh.j2"
    dest: "/usr/local/bin/{{ backup_name }}-backup"
    owner: "root"
    group: "root"
    mode: "0755"

- name: "Deploy backup crontab entry"
  become: true
  ansible.builtin.blockinfile:
    path: "/etc/crontabs/root"
    marker: "# {mark} ANSIBLE BACKUP {{ backup_name }} CRON"
    block: "{{ backup_cron_schedule }} /usr/local/bin/{{ backup_name }}-backup"
    create: true
    owner: "root"
    group: "root"
    mode: "0600"

- name: "Enable and start crond"
  become: true
  ansible.builtin.service:
    name: "crond"
    enabled: true
    state: "started"