From 5dc328b1aa33406897d7fc40f3fdbf93e84a195d Mon Sep 17 00:00:00 2001 From: Vlad Date: Sun, 1 Feb 2026 15:32:27 +0000 Subject: [PATCH] Added watchdog set function --- home_linux/enable_watchdog.yaml | 28 +++++++++++++++++++ home_linux/install_longhorn_deps.yml | 20 +++++++++++++ home_linux/k3s_stuff/disable_swap.yml | 12 ++++++-- .../k3s_stuff/roles/common/vars/main.yml | 18 ++++++------ 4 files changed, 66 insertions(+), 12 deletions(-) create mode 100644 home_linux/enable_watchdog.yaml create mode 100644 home_linux/install_longhorn_deps.yml diff --git a/home_linux/enable_watchdog.yaml b/home_linux/enable_watchdog.yaml new file mode 100644 index 0000000..5a5635e --- /dev/null +++ b/home_linux/enable_watchdog.yaml @@ -0,0 +1,28 @@ +--- +- name: Enable hardware watchdog + hosts: all + gather_facts: no + roles: + - common + become: yes + + tasks: + - name: Enable systemd watchdog in system.conf + ansible.builtin.lineinfile: + path: /etc/systemd/system.conf + regexp: '^#?{{ item.key }}=' + line: "{{ item.key }}={{ item.value }}" + loop: + - { key: 'RuntimeWatchdogSec', value: '15' } + - { key: 'RebootWatchdogSec', value: '10min' } + notify: Restart systemd + + - name: Ensure watchdog device permissions (Optional/Standard) + ansible.builtin.shell: | + modprobe bcm2835_wdt + changed_when: false + + handlers: + - name: Restart systemd + ansible.builtin.systemd: + daemon_reexec: yes diff --git a/home_linux/install_longhorn_deps.yml b/home_linux/install_longhorn_deps.yml new file mode 100644 index 0000000..6ed4335 --- /dev/null +++ b/home_linux/install_longhorn_deps.yml @@ -0,0 +1,20 @@ +--- +- name: Update and upgrade packages on Raspberries + hosts: kubernetes + roles: + - common + become: yes + + tasks: + + - name: Update package repositories + apt: update_cache=yes force_apt_get=yes cache_valid_time=3600 + + - name: Upgrade packages on targets + apt: upgrade=dist force_apt_get=yes + + - name: Install open-iscsi + apt: + name: open-iscsi + state: present + diff --git a/home_linux/k3s_stuff/disable_swap.yml b/home_linux/k3s_stuff/disable_swap.yml index 7bfe451..59e6a83 100644 --- a/home_linux/k3s_stuff/disable_swap.yml +++ b/home_linux/k3s_stuff/disable_swap.yml @@ -1,6 +1,6 @@ --- - name: Disable swap on Raspberries - hosts: all + hosts: kubernetes roles: - common become: yes @@ -8,8 +8,14 @@ tasks: - - name: Disable swap - ansible.builtin.shell: sudo swapoff -a + - name: Stop swap service + ansible.builtin.shell: dphys-swapfile swapoff + + - name: Disable swap service + ansible.builtin.shell: systemctl disable dphys-swapfile + + - name: Delete swap file + ansible.builtin.shell: dphys-swapfile uninstall - name: Reboot ansible.builtin.reboot: diff --git a/home_linux/k3s_stuff/roles/common/vars/main.yml b/home_linux/k3s_stuff/roles/common/vars/main.yml index 1a35c55..a8784fa 100644 --- a/home_linux/k3s_stuff/roles/common/vars/main.yml +++ b/home_linux/k3s_stuff/roles/common/vars/main.yml @@ -1,10 +1,10 @@ $ANSIBLE_VAULT;1.1;AES256 -34323466633533666237623830316138373237326134336236613536633664373564633163613230 -3938393338663632613061646365613630373635613536360a613039306363616432633030306334 -33353839346339393965616234323561306338626533363238306662383938626364303061633332 -6230623361393438610a383230376431373034306331376536313831633366373665393866373338 -65313334623131323931353436623265623033396266623364313934383865386532623630336164 -32653432613065303363303730353864353739633530376637333662303134613339353062303932 -33646466383561373264333734626364663763393766666664653365386230393562626563376265 -63303939363932636266303566363062643166343064343762313339353839326361383062653036 -6232 +30633834386366326437646166323334396138353739343932333030646534663939353664623132 +3132376461376265646335333462306135643361343366620a633835303133306134613433313833 +38323961306433633466643139666566636365313538313062636161373130313633393265313162 +3537633336316361330a323462613431363138363035383532636166613434393661663832616532 +63633632383431653930363638326237663533316632666266653734396165393130386238323661 +65653832343031356130303961333134656139306165666234343737386362343939376435663332 +64366535366265366532393130363862376363323664666362663663613238653564613963616138 +33383635373133343032313834376232623166393161616136663566303437656536376536646439 +3163