sicherung mit ytdl entfernt (#21)

This commit is contained in:
Quotengrote 2020-08-29 16:08:04 +02:00 committed by GitHub
parent 114f4afe91
commit 807332bb74
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 57 deletions

View file

@ -20,25 +20,6 @@
smb_workgroup: WORKGROUP
smb_nutzer_loeschen:
- { name: 'platzhalter' }
### mgrote.sicherung_medien
sicherung_medien_username: michael.grote@posteo.de
sicherung_medien_passwort: "{{ lookup('keepass', 'sicherung_medien_passwort', 'password') }}"
youtubedl_update: false
youtubedl_cron_minutes: "40"
youtubedl_cron_hours: "21"
youtubedl_cron_day: "*/2,*/5"
playlisten_youtube:
- { url: 'https://www.youtube.com/playlist?list=PLPM-eyPokAWNhhDNO4YzC5cGRwuI2ykwE', titel: 'music'}
- { url: 'https://www.youtube.com/playlist?list=PLPM-eyPokAWNnDxuyX131R5wkl8fzvu7D', titel: 'lost and found'}
- { url: 'https://www.youtube.com/playlist?list=PLPM-eyPokAWPmStfh37roJge-JuLfgma0', titel: 'lost and found 2'}
- { url: 'https://www.youtube.com/watch?v=rj1RVBjEbTY&list=PLKSNR-nHKRS9B_mdvJp1m48augOyIL1zJ', titel: 'Sommerfigur in 14 Tagen'}
- { url: 'https://www.youtube.com/watch?v=ba60qzHoBL0&list=PLKSNR-nHKRS_jbfveFFlD07PUdEHg8Nlt', titel: '14 Tage Abnehmen & Figur'}
- { url: 'https://www.youtube.com/channel/UCwRH985XgMYXQ6NxXDo8npw', titel: 'Kurzgesagt - Deutsch'}
- { url: 'https://www.youtube.com/channel/UCsXVk37bltHxD1rDPwtNM8Q', titel: 'Kurzgesagt - Englisch'}
- { url: 'https://www.youtube.com/watch?v=siIQ1jPtmEQ&list=PLs4hTtftqnlAkiQNdWn6bbKUr-P1wuSm0', titel: 'Jimmy Kimmel - Mean Tweets'}
playlisten_podcast:
- { url: 'https://sternengeschichten.podigee.io/feed/aac', titel: 'Kurzgesagt - Deutsch'}
- { url: 'https://feeds.br.de/radiowissen/feed.xml', titel: 'Kurzgesagt - Englisch'}
### mgrote.nextcloud_sicherung
nextcloud_sicherung_cron_minutes: "20"
nextcloud_sicherung_cron_hours: "21"

View file

@ -16,6 +16,5 @@
roles:
- { role: mgrote.postfix-gmail, tags: "postfix-gmail" }
- { role: mgrote.fileserver_smb, tags: "fileserver_smb" }
- { role: mgrote.sicherung_medien, tags: "youtube-dl", when: ansible_hostname == "fileserver2", become: true }
- { role: mgrote.sicherung_nextcloud, tags: "nextcloud_sicherung", when: ansible_hostname == "fileserver2" }
- { role: mgrote.sicherung_cloud, tags: "cloud", when: ansible_hostname == "fileserver2" }

View file

@ -2,46 +2,37 @@
become: yes
apt:
name: ffmpeg
state: present
state: absent
- name: create /etc/sicherung_medien
become: yes
file:
path: /etc/sicherung_medien
state: directory
state: absent
- name: create sicherung_medien_* log
become: true
file:
path: "{{ item }}"
state: touch
owner: root
group: root
mode: 0644
access_time: preserve
modification_time: preserve
state: absent
with_items:
- /var/log/sicherung_medien_youtube.log
- /var/log/sicherung_medien_podcast.log
- name: copy conf-*.txt
become: yes
template:
src: "{{ item }}"
dest: "/etc/sicherung_medien/{{ item }}"
owner: root
group: root
mode: 0700
file:
path: "/etc/sicherung_medien/{{ item }}"
state: absent
with_items:
- conf-youtube.txt
- conf-podcast.txt
- name: copy ytdl-*.sh
become: yes
template:
src: "{{ item }}"
dest: "/usr/local/bin/{{ item }}"
mode: a+x
file:
path: "/usr/local/bin/{{ item }}"
state: absent
with_items:
- ytdl-youtube.sh
- ytdl-podcast.sh
@ -50,7 +41,7 @@
become: yes
cron:
name: sicherung_medien_{{ item }}
state: present
state: absent
job: "/usr/local/bin/{{ item }}"
minute: "{{ youtubedl_cron_minutes }}"
hour: "{{ youtubedl_cron_hours }}"
@ -61,25 +52,9 @@
- name: Add logs to logrotate
become: true
blockinfile:
file:
path: "/etc/logrotate.d/{{ item }}"
state: present
create: yes
owner: root
group: root
mode: 0644
block: |
/var/log/{{ item }} {
su root root
create 0640 root root
rotate 4
weekly
compress
missingok
notifempty
dateext
dateyesterday
}
state: absent
with_items:
- sicherung_medien_youtube.log
- sicherung_medien_podcast.log