summaryrefslogtreecommitdiff
path: root/chaos-at-home/ch-prometheus.yml
blob: 4ecc415e136f875bd6d3b1170080476482919579 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
---
- name: Basic Setup
  hosts: ch-prometheus
  roles:
  - role: apt-repo/base
  - role: core/base
  - role: core/sshd
  - role: core/zsh
  - role: core/cpu-microcode
  - role: cryptdisk
  - role: zfs/base
  - role: apt-repo/spreadspace
  - role: zfs/sanoid
  - role: chaos-at-home/fileserver
  - role: vm/host/base
  - role: vm/host/network
  - role: installer/debian/base
  - role: installer/openbsd/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() %}
        echo -e "opening crypto volume: \033[1;37m{{ name }}\033[0m"
        cryptsetup luksOpen '{{ volume.device }}' '{{ name }}'
        {% endfor %}

        systemctl restart zfs-import-cache.service
        systemctl restart zfs-mount.service
        systemctl restart zfs-share.service
        systemctl restart zfs-zed.service
        mount -a

        sleep 2
        systemctl restart libvirtd.service
        systemctl restart nfs-kernel-server

  - name: install dstat script
    copy:
      dest: /usr/local/bin/dstat.sh
      mode: 0755
      content: |
        #!/bin/bash
        exec dstat -cnd -N enp1s0,bond0 -D nvme0n1,nvme1n1,sda,sdb,sdc  --disk-util --top-io --top-bio