homeserver/roles/mgrote.sicherung_nextcloud/tasks/main.yml
2020-08-18 11:57:53 +02:00

64 lines
1.4 KiB
YAML

- name: Erstelle nextcloud
become: yes
file:
path: /etc/nextcloud
state: directory
- name: "Kopiere rclone.conf"
become: yes
template:
src: rclone.conf
dest: /etc/nextcloud/rclone.conf
owner: root
group: root
mode: 0700
- name: "Kopiere nextcloud.sh"
become: yes
template:
src: nextcloud.sh
dest: /usr/local/bin/nextcloud-sicherung.sh
mode: a+x
- name: cronjob fuer nextcloud-copy anlegen
become: yes
cron:
name: nextcloud
state: present
job: "/usr/local/bin/nextcloud-sicherung.sh"
minute: "{{ nextcloud_sicherung_cron_minutes }}"
hour: "{{ nextcloud_sicherung_cron_hours }}"
- name: Create nextcloud-sicherung log
become: true
file:
path: /var/log/nextcloud-sicherung.log
state: touch
owner: root
group: root
mode: 0644
access_time: preserve
modification_time: preserve
- name: Add nextcloud Log to be Rotated
become: true
blockinfile:
path: /etc/logrotate.d/nextcloud-sicherung
state: present
create: yes
owner: root
group: root
mode: 0644
block: |
/var/log/nextcloud-sicherung.log {
su root root
create 0640 root root
rotate 4
weekly
compress
missingok
notifempty
dateext
dateyesterday
}