From 3ac1a667fa7f9017e97c2fa1c470d125c84c04b5 Mon Sep 17 00:00:00 2001 From: Christian Pointner Date: Mon, 1 Jun 2020 23:38:01 +0200 Subject: upgrade sk-2019 to new zfs deployment --- dan/sk-2019.yml | 94 +++++++++++++++++++++++++++++++++++++++++---------------- 1 file changed, 68 insertions(+), 26 deletions(-) (limited to 'dan') diff --git a/dan/sk-2019.yml b/dan/sk-2019.yml index b5f048e5..ac362ebd 100644 --- a/dan/sk-2019.yml +++ b/dan/sk-2019.yml @@ -1,33 +1,63 @@ --- - name: Basic Setup hosts: sk-2019 - tasks: - - debug: - msg: "please use the branch topic/skillz-legacy for this host" - #roles: - # - role: apt-repo/base - # - role: core/base + roles: + - role: apt-repo/base + - role: core/base # - role: core/sshd - # - role: core/zsh - # - role: core/cpu-microcode - # - role: core/admin-users - # - role: cryptdisk - # - role: zfs/base - # tasks: - # - name: install post-boot script - # copy: - # dest: /usr/local/bin/post-boot - # mode: 0755 - # content: | - # #!/bin/bash - # set -e - - # {% for name, volume in cryptdisk_volumes.items() %} - # cryptsetup luksOpen '{{ volume.device }}' '{{ name }}' - # {% endfor %} - # systemctl restart zfs-import-cache.service - # systemctl restart zfs-mount.service - # mount -a + - role: core/zsh + - role: core/cpu-microcode + - role: core/admin-users + - role: cryptdisk + - role: zfs/base + tasks: + - name: install post-boot script + copy: + dest: /usr/local/bin/post-boot + mode: 0755 + content: | + #!/bin/bash + set -e + + {% for name, volume in cryptdisk_volumes.items() %} + cryptsetup luksOpen '{{ volume.device }}' '{{ name }}' + {% endfor %} + systemctl restart zfs-import-cache.service + systemctl restart zfs-mount.service + mount -a + systemctl restart mariadb.service + systemctl restart apache2.service + + - name: install ispconfig fix systemd service unit + copy: + dest: /etc/systemd/system/fix-fstab.service + content: | + [Unit] + Description=fix fstab entries made by ispconfig + + [Service] + Type=oneshot + ExecStart=/usr/bin/sed s/bind,nobootwait/bind,nofail/ -i /etc/fstab + + - name: install ispconfig fix systemd service unit + copy: + dest: /etc/systemd/system/fix-fstab.timer + content: | + [Unit] + Description=fix fstab entries made by ispconfig + + [Timer] + OnCalendar=*-*-* *:*:00 + + [Install] + WantedBy=timers.target + + - name: enable and start fstab fix + systemd: + name: fix-fstab.timer + daemon_reload: yes + enabled: yes + state: started ### TODO: # @@ -52,3 +82,15 @@ # # mount -a # + + +########### manual post-boot + +# cat /etc/fstab | grep "^/var/log" | awk '{ system("umount "$2) }' +# umount /srv/storage/www/clients/client2/web2/web/shared/fileadmin/wolke +# umount /srv/storage/www/clients/client2/web2/web/shared/fileadmin/wolke +# umount /srv/storage/www/clients/client2/web2/web/shared/fileadmin/wolke +# mount | grep systemd-1 | awk '{ print($3) }' | grep "^/var" | xargs umount +# mount | grep systemd-1 | awk '{ print($3) }' | grep "^/var" | xargs umount +# mount | grep systemd-1 | awk '{ print($3) }' | grep "^/var" | xargs umount +# rm -rf /srv/storage/* -- cgit v1.2.3