Feature 57 (config and provisioning): modules declare config and provisions, their files rendered from templates; synced with main (issues of feature 57, 874)

This commit is contained in:
2026-10-16 07:37:43 +00:00
parent 1a2c917abf
commit 9652b2d5ce
771 changed files with 52063 additions and 1774 deletions
+47 -19
View File
@@ -8,23 +8,46 @@
"snapshot.taken",
"scrub.requested"
],
"settings": {
"scrub-cadence": {
"kind": "preference",
"default": "weekly",
"why": "how often the pool named by scrub-pool is scrubbed, weekly or monthly (the first scrub-day of each month); weekly is what the distribution's timer did on the home server before the module, so taking it over moves nothing until the operator chooses"
"config": {
"scrub-pool": {
"type": "string",
"description": "The name of the ZFS pool the module scrubs; the operator's, with no default.",
"trusted": true,
"required": true
},
"scrub-cadence": {
"type": "string",
"description": "How often the pool named by scrub-pool is scrubbed: weekly, or monthly on the first scrub-day of each month. Weekly is what the distribution's timer did on the home server before the module, so taking it over moves nothing until the operator chooses.",
"enum": [
"weekly",
"monthly"
],
"trusted": true,
"default": "weekly"
},
"scrub-day": {
"type": "string",
"description": "The weekday the scrub starts, Mon to Sun; for a monthly scrub, the first such day of the month. Checked by the scheduled run, which refuses any other value and runs nothing; Monday is when the distribution's weekly timer fired.",
"enum": [
"Mon",
"Tue",
"Wed",
"Thu",
"Fri",
"Sat",
"Sun"
],
"trusted": true,
"default": "Mon"
},
"scrub-time": {
"type": "string",
"description": "The time the scrub starts, HH:MM from 00:00 to 23:59 in the machine's time zone; the scheduled run checks it every quarter of an hour, so the scrub starts within 15 minutes of it. Midnight is when the distribution's weekly timer fired.",
"pattern": "([01][0-9]|2[0-3]):[0-5][0-9]",
"trusted": true,
"default": "00:00"
}
},
"scrub-day": {
"kind": "preference",
"default": "Mon",
"why": "the weekday the scrub starts, Mon to Sun: for a monthly scrub, the first such day of the month. Checked by the scheduled run, which refuses any other value and runs nothing; Monday is when the distribution's weekly timer fired"
},
"scrub-time": {
"kind": "preference",
"default": "00:00",
"why": "the time the scrub starts, HH:MM from 00:00 to 23:59 in the machine's time zone; the scheduled run checks it every quarter of an hour, so the scrub starts within 15 minutes of it. Midnight is when the distribution's weekly timer fired"
}
},
"tools": [
"zfs_datasets",
"zfs_snapshots",
@@ -151,7 +174,7 @@
"type": "file",
"path": "/etc/zfs-tools/scrub.conf",
"mode": "0644",
"content": "# Written by the mesh (module zfs) from this machine's assignment. Replaced on every push; change the\n# settings scrub-pool, scrub-cadence, scrub-day and scrub-time, never this file. The module's tools read it.\npool=${setting:scrub-pool}\ncadence=${setting:scrub-cadence}\nday=${setting:scrub-day}\ntime=${setting:scrub-time}\n"
"template": "files/scrub.conf"
},
{
"id": "scrub-state-dir",
@@ -173,14 +196,14 @@
{
"id": "distribution-weekly",
"type": "service",
"unit": "zfs-scrub-weekly@${setting:scrub-pool}.timer",
"unit": "zfs-scrub-weekly@${config:scrub-pool}.timer",
"state": "stopped",
"boot": "disabled"
},
{
"id": "distribution-monthly",
"type": "service",
"unit": "zfs-scrub-monthly@${setting:scrub-pool}.timer",
"unit": "zfs-scrub-monthly@${config:scrub-pool}.timer",
"state": "stopped",
"boot": "disabled"
}
@@ -197,6 +220,11 @@
"loads": [
"zfs-tools"
]
},
{
"name": "files",
"kind": "archive",
"from": "files"
}
]
}