diff --git a/hosts b/hosts index 1003578..879b7ce 100644 --- a/hosts +++ b/hosts @@ -44,28 +44,28 @@ all: children: k3s-server: hosts: - k3s-s0: + k3s-server0: ansible_host: 192.168.20.20 - platform: raspberrypi - k3s-agent: - hosts: - k3s-w0: - ansible_host: 192.168.20.21 - platform: raspberrypi - k3s-w1: - ansible_host: 192.168.20.22 - platform: raspberrypi - k3s-w2: - ansible_host: 192.168.20.23 - platform: raspberrypi - k3s-w3: - ansible_host: 192.168.20.24 platform: vm k3s_extra_args: --node-taint kubernetes.io/arch=amd64:PreferNoSchedule + k3s-agent: + hosts: + k3s-agent0: + ansible_host: 192.168.20.21 + platform: raspberrypi + k3s-agent1: + ansible_host: 192.168.20.22 + platform: raspberrypi + k3s-agent2: + ansible_host: 192.168.20.23 + platform: raspberrypi + k3s-agent3: + ansible_host: 192.168.20.24 + platform: raspberrypi debian: hosts: ubiquiti: - ansible_host: 192.168.10.2 + ansible_host: 192.168.10.3 pihole: ansible_host: 192.168.20.2 children: diff --git a/roles/k3s-agent/tasks/main.yml b/roles/k3s-agent/tasks/main.yml index 7adbdbd..df5b408 100644 --- a/roles/k3s-agent/tasks/main.yml +++ b/roles/k3s-agent/tasks/main.yml @@ -11,4 +11,5 @@ systemd: name: k3s daemon_reload: yes + state: started enabled: yes diff --git a/roles/k3s-server/tasks/main.yml b/roles/k3s-server/tasks/main.yml index 62eafb3..fac7e8a 100644 --- a/roles/k3s-server/tasks/main.yml +++ b/roles/k3s-server/tasks/main.yml @@ -11,6 +11,7 @@ systemd: name: k3s daemon_reload: yes + state: started enabled: yes - name: Wait for server node-token to be available diff --git a/roles/k3s/files/50-rpi-fan.rules b/roles/k3s/files/50-rpi-fan.rules deleted file mode 100644 index 7c48a77..0000000 --- a/roles/k3s/files/50-rpi-fan.rules +++ /dev/null @@ -1,18 +0,0 @@ -SUBSYSTEM=="thermal" -KERNEL=="thermal_zone0" - -# If the temp hits 75c, turn on the fan. Turn it off again when it goes back down to 70. -ATTR{trip_point_3_temp}=="75000" -ATTR{trip_point_3_hyst}=="5000" - -# If the temp hits 78c, higher RPM. -ATTR{trip_point_2_temp}=="78000" -ATTR{trip_point_2_hyst}=="2000" - -# If the temp hits 80c, higher RPM. -ATTR{trip_point_1_temp}=="80000" -ATTR{trip_point_1_hyst}=="2000" - -# If the temp hits 81c, highest RPM. -ATTR{trip_point_0_temp}=="81000" -ATTR{trip_point_0_hyst}=="5000" \ No newline at end of file diff --git a/roles/k3s/files/cmdline.txt b/roles/k3s/files/cmdline.txt deleted file mode 100644 index 49d2647..0000000 --- a/roles/k3s/files/cmdline.txt +++ /dev/null @@ -1 +0,0 @@ -net.ifnames=0 dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=LABEL=writable rootfstype=ext4 fsck.mode=force elevator=deadline rootwait fixrtc cgroup_memory=1 cgroup_enable=memory \ No newline at end of file diff --git a/roles/k3s/tasks/raspberrypi.yml b/roles/k3s/tasks/raspberrypi.yml index 9475c60..a1a73b4 100644 --- a/roles/k3s/tasks/raspberrypi.yml +++ b/roles/k3s/tasks/raspberrypi.yml @@ -8,14 +8,20 @@ mode: 0755 notify: reboot -- name: Configure poe hat fan speed control udev rules - copy: - src: 50-rpi-fan.rules - dest: /etc/udev/rules.d/50-rpi-fan.rules +- name: Configure poe hat fan speed control + blockinfile: + path: /boot/config.txt + block: | + dtparam=poe_fan_temp0=65000 + dtparam=poe_fan_temp1=70000 + dtparam=poe_fan_temp2=75000 + dtparam=poe_fan_temp3=80000 notify: reboot -- name: Configure kernel command line parameters - copy: - src: cmdline.txt - dest: /boot/firmware/cmdline.txt +- name: Enable cgroup memory + lineinfile: + path: /boot/cmdline.txt + backrefs: true + regexp: '^(.+ rootwait).*$' + line: '\1 cgroup_memory=1 cgroup_enable=memory' notify: reboot