diff --git a/basics.yml b/basics.yml index b3a5679..6a90a6e 100644 --- a/basics.yml +++ b/basics.yml @@ -303,94 +303,6 @@ notify: - Restart journald - - name: Create updates dir /usr/local/sbin/autoupdate.d - ansible.builtin.file: - path: /usr/local/sbin/autoupdate.d - owner: root - group: root - state: directory - mode: "0700" - - - name: /usr/local/sbin/autoupdate.sh - blockinfile: - path: /usr/local/sbin/autoupdate.sh - mode: "0500" - owner: root - group: root - create: yes - marker: "# {mark} ANSIBLE MANAGED BLOCK" - block: | - . /etc/bash/gaboshlib.include - g_nice - g_lockfile - g_all-to-syslog - set -o pipefail - find /usr/local/sbin/autoupdate.d -name "*.update" -type f | sort | while read update - do - g_echo "Running: $update" - . "$update" - sleep 60 - done - backup: yes - validate: /bin/bash -n %s - - - name: /usr/local/sbin/autoupdate.sh shebang - lineinfile: - path: /usr/local/sbin/autoupdate.sh - insertbefore: BOF - line: "#!/bin/bash" - - - name: /usr/local/sbin/autoupdate.d/debian.update - blockinfile: - path: /usr/local/sbin/autoupdate.d/debian.update - mode: "0400" - owner: root - group: root - create: yes - marker: "# {mark} ANSIBLE MANAGED BLOCK" - block: | - g_echo_ok "Prüfe auf Systemupdates" - apt-get update || g_echo_error "apt-get update fehlgeschlagen" - if ! apt-get -s dist-upgrade 2>&1 | sed -e "s/'/'\\\\''/g; 1s/^/'/; \$s/\$/'/" | tee $g_tmp/sys-updatelist | egrep "^0.+, 0 .+, 0 .+ 0 .+\." - then - g_echo_warn "Systemupdate wird eingespielt: $(cat $g_tmp/sys-updatelist)" - DEBIAN_FRONTEND=noninteractive apt-get -yy dist-upgrade | sed -e "s/'/'\\\\''/g; 1s/^/'/; \$s/\$/'/" | tee $g_tmp/sys-update || g_echo_error "apt-get -yy dist-upgrade failed $($g_tmp/sys-update)" - DEBIAN_FRONTEND=noninteractive needrestart -b -r a | egrep -q "^NEEDRESTART-KSTA: [2|3]" && g_echo_warn "Server Reboot benötigt" - fi - backup: yes - validate: /bin/bash -n %s - - - name: /etc/cron.d/autoupdate_local - blockinfile: - path: /etc/cron.d/autoupdate_local - mode: "0400" - owner: root - group: root - create: yes - marker: "# {mark} ANSIBLE MANAGED BLOCK" - block: | - ## Auto-Update - 5 6 * * * root /usr/local/sbin/autoupdate.sh - backup: yes - -# - name: Autoupdate -# copy: -# src: configs/usr/local/sbin/autoupdate.sh -# dest: /usr/local/sbin/autoupdate.sh -# owner: root -# group: root -# mode: "0555" -# backup: yes -# validate: /bin/bash -n %s -# - name: Autoupdate Cronb -# copy: -# src: configs/etc/cron.d/autoupdate_local -# dest: /etc/cron.d/autoupdate_local -# owner: root -# group: root -# mode: "0444" -# backup: yes - - name: /etc/rsyslog.d/00-services-remote.conf blockinfile: path: /etc/rsyslog.d/00-services-remote.conf