homeserver/roles/mgrote.sicherung_cloud/tasks/main.yml

63 lines
1.4 KiB
YAML
Raw Normal View History

2020-08-18 11:57:53 +02:00
- name: Ordner "/etc/sicherung_cloud" erstellen
become: yes
file:
path: /etc/sicherung_cloud
state: directory
- name: Kopiere rclone.conf
become: yes
template:
src: rclone.conf
dest: /etc/sicherung_cloud/rclone.conf
force: no #sorgt dafuer fas die Datei nur kopiert wird wenn sie noch nicht existiert
owner: root
group: root
mode: 0700
- name: Kopiere rclone.sh
become: yes
template:
src: rclone.sh
dest: /usr/local/bin/sicherung_cloud.sh
mode: a+x
- name: cronjob fuer rclone anlegen
become: yes
cron:
name: rclone
state: present
job: "/usr/local/bin/sicherung_cloud.sh"
minute: "{{ rclone_cron_minutes }}"
hour: "{{ rclone_cron_hours }}"
- name: Create sicherung-cloud log
become: true
file:
path: /var/log/sicherung_cloud.log
state: touch
mode: 0775
access_time: preserve
modification_time: preserve
- name: Add sicherung-cloud log to be Rotated
become: true
blockinfile:
path: /etc/logrotate.d/sicherung-cloud
state: present
create: yes
owner: root
group: root
mode: 0644
block: |
/var/log/sicherung_cloud.log {
su root root
create 0640 root root
rotate 4
weekly
compress
missingok
notifempty
dateext
dateyesterday
}