From 807332bb74d9f5feb570a1143f048f5771243f9d Mon Sep 17 00:00:00 2001 From: Quotengrote <38253905+quotengrote@users.noreply.github.com> Date: Sat, 29 Aug 2020 16:08:04 +0200 Subject: [PATCH] sicherung mit ytdl entfernt (#21) --- inventories/group_vars/storage.yml | 19 -------- playbooks/service/fileserver.yml | 1 - roles/mgrote.sicherung_medien/tasks/main.yml | 49 +++++--------------- 3 files changed, 12 insertions(+), 57 deletions(-) diff --git a/inventories/group_vars/storage.yml b/inventories/group_vars/storage.yml index ac7e227b..abdb17be 100644 --- a/inventories/group_vars/storage.yml +++ b/inventories/group_vars/storage.yml @@ -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" diff --git a/playbooks/service/fileserver.yml b/playbooks/service/fileserver.yml index d92ea0e5..3e4c895c 100644 --- a/playbooks/service/fileserver.yml +++ b/playbooks/service/fileserver.yml @@ -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" } diff --git a/roles/mgrote.sicherung_medien/tasks/main.yml b/roles/mgrote.sicherung_medien/tasks/main.yml index 61fe2446..0e69579e 100644 --- a/roles/mgrote.sicherung_medien/tasks/main.yml +++ b/roles/mgrote.sicherung_medien/tasks/main.yml @@ -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