Added watchdog set function

This commit is contained in:
Vlad 2026-02-01 15:32:27 +00:00
parent aa7627f2e5
commit 5dc328b1aa
4 changed files with 66 additions and 12 deletions

View File

@ -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

View File

@ -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

View File

@ -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:

View File

@ -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