Skip to content

Commit f876cad

Browse files
committed
Update storage role defaults
- Don't run checks/validations by default - Do configure networking by default - Skip xz-utils installation on debian when possible
1 parent a07c428 commit f876cad

File tree

5 files changed

+32
-16
lines changed

5 files changed

+32
-16
lines changed

metal/roles/storage/defaults/main.yml

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ firewall_allowed_networks: # NB! The default will only allow connections (includ
1919
- "{{ homelab_net_cidr }}"
2020

2121
# Network configuration (optional)
22-
configure_network: false
22+
configure_network: true
2323
storage_network:
2424
interface: "{{ network_interface | default('eth0') }}"
2525
address: "{{ ansible_host }}"
@@ -29,17 +29,6 @@ storage_network:
2929
- "10.10.10.1"
3030
- "1.1.1.1"
3131

32-
# Disk health validation
33-
enable_disk_health_checks: false
34-
prefer_native_utils: false # Use smartctl by default, set true for brand-specific tools
35-
fail_on_unhealthy_drives: false # Warning only by default
36-
37-
disk_health_thresholds:
38-
max_temperature_celsius: 60
39-
max_reallocated_sectors: 50
40-
max_pending_sectors: 0
41-
max_uncorrectable_errors: 0
42-
4332
# Snapraid maintenance configuration
4433
snapraid_maintenance:
4534
# Daily sync schedule (systemd timer format)
@@ -78,5 +67,21 @@ snapraid_maintenance:
7867
content_backup_enabled: true
7968
content_backup_count: 5 # Keep last N backups
8069

70+
# Don't upgrade all packages on each run
8171
# Set to true (e.g. via cli: '-e upgrade_packages=true') to upgrade all packages on the host
8272
upgrade_packages: false
73+
74+
# Healthchecks, validations, tests, etc.
75+
76+
# Disk health validation
77+
enable_disk_health_checks: false
78+
prefer_native_utils: false # Use smartctl by default, set true for brand-specific tools
79+
fail_on_unhealthy_drives: false # Warning only by default
80+
disk_health_thresholds:
81+
max_temperature_celsius: 60
82+
max_reallocated_sectors: 50
83+
max_pending_sectors: 0
84+
max_uncorrectable_errors: 0
85+
86+
# Run nfs validations
87+
validate_nfs: false
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.deb
2+
*.rpm

metal/roles/storage/tasks/network.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
dest: /etc/network/interfaces
66
owner: root
77
group: root
8-
mode: '0644'
8+
mode: "0644"
99
backup: true
1010
when: ansible_os_family == 'Debian'
1111
notify: restart networking debian
@@ -16,7 +16,7 @@
1616
dest: "/etc/sysconfig/network-scripts/ifcfg-{{ storage_network.interface }}"
1717
owner: root
1818
group: root
19-
mode: '0644'
19+
mode: "0644"
2020
backup: true
2121
when: ansible_os_family == 'RedHat'
2222
notify: restart networking redhat

metal/roles/storage/tasks/nfs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,12 @@
6262

6363
- name: Validate NFS exports
6464
include_tasks: nfs_validation.yml
65+
when: validate_nfs
6566

6667
- name: Validate NFS-K8S integration
6768
include_tasks:
6869
file: k8s_validation.yml
6970
apply:
7071
become: false
7172
delegate_to: localhost
73+
when: validate_nfs

metal/roles/storage/tasks/setup_debian.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
- name: Ensure base packages
99
apt:
1010
name:
11-
# temp 'apt' module dependency for installing .deb
12-
- xz-utils
1311
# hardware monitoring
1412
- lm-sensors
1513
# nfs
@@ -30,6 +28,15 @@
3028
owner: root
3129
group: root
3230
mode: "0755"
31+
register: snapraid_deb
32+
33+
- name: Ensure apt module dependencies
34+
apt:
35+
name:
36+
# temp 'apt' module dependency for installing .deb
37+
- xz-utils
38+
state: present
39+
when: snapraid_deb is changed
3340

3441
- name: Install snapraid
3542
apt:

0 commit comments

Comments
 (0)