EvoBSD/roles/base/tasks/evobackup.yml
Jérémy Dubois 6b7c7b80c4
Some checks failed
continuous-integration/drone/push Build is failing
yamllint
2020-10-12 14:20:59 +02:00

43 lines
975 B
YAML

---
- name: Copy zzz_evobackup script
copy:
src: zzz_evobackup
dest: /usr/share/scripts/zzz_evobackup
owner: root
group: wheel
mode: "0755"
force: false
tags:
- evobackup
- name: Fetch daily.local content
command: 'grep "sh /usr/share/scripts/zzz_evobackup" /etc/daily.local'
check_mode: false
register: daily_local_content
failed_when: false
changed_when: false
tags:
- evobackup
- name: Add evobackup cron (disabled)
lineinfile:
path: /etc/daily.local
line: '#sh /usr/share/scripts/zzz_evobackup'
owner: root
mode: "0644"
create: true
when:
- not (daily_local_content.stdout
| regex_search('sh /usr/share/scripts/zzz_evobackup'))
tags:
- evobackup
- name: Delete evobackup root crontab replaced by daily.local cron
lineinfile:
path: /var/cron/tabs/root
regexp: '/usr/share/scripts/zzz_evobackup'
validate: /usr/bin/crontab %s
state: absent
tags:
- evobackup