homeserver/roles/mgrote.sicherung_medien/tasks/main.yml
2020-08-29 16:08:04 +02:00

60 lines
1.3 KiB
YAML

- name: install ffmpeg
become: yes
apt:
name: ffmpeg
state: absent
- name: create /etc/sicherung_medien
become: yes
file:
path: /etc/sicherung_medien
state: absent
- name: create sicherung_medien_* log
become: true
file:
path: "{{ item }}"
state: absent
with_items:
- /var/log/sicherung_medien_youtube.log
- /var/log/sicherung_medien_podcast.log
- name: copy conf-*.txt
become: yes
file:
path: "/etc/sicherung_medien/{{ item }}"
state: absent
with_items:
- conf-youtube.txt
- conf-podcast.txt
- name: copy ytdl-*.sh
become: yes
file:
path: "/usr/local/bin/{{ item }}"
state: absent
with_items:
- ytdl-youtube.sh
- ytdl-podcast.sh
- name: create cronjob sicherung_medien_*
become: yes
cron:
name: sicherung_medien_{{ item }}
state: absent
job: "/usr/local/bin/{{ item }}"
minute: "{{ youtubedl_cron_minutes }}"
hour: "{{ youtubedl_cron_hours }}"
day: "{{ youtubedl_cron_day }}"
with_items:
- ytdl-youtube.sh
- ytdl-podcast.sh
- name: Add logs to logrotate
become: true
file:
path: "/etc/logrotate.d/{{ item }}"
state: absent
with_items:
- sicherung_medien_youtube.log
- sicherung_medien_podcast.log