From c35f81871c5b6783a0ce1769a1272f11564ea3f5 Mon Sep 17 00:00:00 2001 From: mustard Date: Mon, 20 Oct 2025 23:42:41 +0200 Subject: [PATCH 01/10] wip: add cure task --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 72e55a7..8da2d9d 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,15 @@ create-bundle: guard-domu mkdir -p .bundles git bundle create - --all > .bundles/qubes-mgmt-salt +# cures common weird states (thanks xyhhx for the tip) +# also try `sudo rm -rf /var/cache/salt /srv/salt/_tops/*` +.PHONY: cure +cure: + sudo rm -rf /var/cache/salt + sudo rm -rf /srv/salt/_tops/* + qubesctl saltutil.clear_cache + qubesctl saltutil.sync_all + .PHONY: pull pull/% pull: pull/$(shell git branch --show-current) pull/%: From 95bfb32459ad31a6531ca16004dce16fad836ee1 Mon Sep 17 00:00:00 2001 From: mustard Date: Mon, 20 Oct 2025 23:44:17 +0200 Subject: [PATCH 02/10] wip: add cure task --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8da2d9d..8e9f943 100644 --- a/Makefile +++ b/Makefile @@ -40,7 +40,7 @@ create-bundle: guard-domu .PHONY: cure cure: sudo rm -rf /var/cache/salt - sudo rm -rf /srv/salt/_tops/* + sudo rm -rf /srv/salt/_tops/user qubesctl saltutil.clear_cache qubesctl saltutil.sync_all From 5b53971da3ae97c6519c7b6db487ea9d8ce113c7 Mon Sep 17 00:00:00 2001 From: mustard Date: Tue, 21 Oct 2025 00:32:46 +0200 Subject: [PATCH 03/10] wip: salt testing --- salt/guardian-vms.sls | 18 ------------------ salt/guardian.top | 3 --- salt/salty.sls | 9 +++++++++ salt/salty.top | 3 +++ 4 files changed, 12 insertions(+), 21 deletions(-) delete mode 100644 salt/guardian-vms.sls delete mode 100644 salt/guardian.top create mode 100644 salt/salty.sls create mode 100644 salt/salty.top diff --git a/salt/guardian-vms.sls b/salt/guardian-vms.sls deleted file mode 100644 index 6e64d1c..0000000 --- a/salt/guardian-vms.sls +++ /dev/null @@ -1,18 +0,0 @@ -create-guardian-template: - qvm.vm: - - name: guardian-template - - clone: - - source: fedora-42 - - label: black - - prefs: - - netvm: "" - -create-app: - qvm.vm: - - name: app - - present: - - template: guardian-template - - label: green - - prefs: - - template: guardian-template - - netvm: "" diff --git a/salt/guardian.top b/salt/guardian.top deleted file mode 100644 index fef8227..0000000 --- a/salt/guardian.top +++ /dev/null @@ -1,3 +0,0 @@ -user: - dom0: - - guardian-vms diff --git a/salt/salty.sls b/salt/salty.sls new file mode 100644 index 0000000..5b6ccbf --- /dev/null +++ b/salt/salty.sls @@ -0,0 +1,9 @@ +create-template: + qvm.vm: + - name: salty-template + - clone: + - source: fedora-42 + - label: black + - prefs: + - netvm: "" + diff --git a/salt/salty.top b/salt/salty.top new file mode 100644 index 0000000..8603187 --- /dev/null +++ b/salt/salty.top @@ -0,0 +1,3 @@ +base: + dom0: + - salty From 998bca2d36fdf8e8cc7a66d90dde8331a0937edb Mon Sep 17 00:00:00 2001 From: mustard Date: Tue, 21 Oct 2025 00:35:38 +0200 Subject: [PATCH 04/10] wip: salty top --- salt/salty.top | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/salty.top b/salt/salty.top index 8603187..ed63f61 100644 --- a/salt/salty.top +++ b/salt/salty.top @@ -1,3 +1,3 @@ -base: +user: dom0: - salty From 67110ce55a39dc4c658752e44206a8d1c0061528 Mon Sep 17 00:00:00 2001 From: mustard Date: Tue, 21 Oct 2025 00:39:41 +0200 Subject: [PATCH 05/10] wip: hmmm --- salt/salty.sls | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/salt/salty.sls b/salt/salty.sls index 5b6ccbf..709560b 100644 --- a/salt/salty.sls +++ b/salt/salty.sls @@ -1,6 +1,6 @@ create-template: qvm.vm: - - name: salty-template + - name: super-salty-template - clone: - source: fedora-42 - label: black From 1f1bd9d33312cd7c6c3896a47a667e64cf3f2422 Mon Sep 17 00:00:00 2001 From: mustard Date: Tue, 21 Oct 2025 00:46:27 +0200 Subject: [PATCH 06/10] wip: tweaking make apply --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8e9f943..f5fca27 100644 --- a/Makefile +++ b/Makefile @@ -74,4 +74,7 @@ install: apply: install -D -oroot -groot -m0644 conf/z_user.conf /etc/salt/minion.d/z_user.conf install -D -oroot -groot -m0644 conf/overrides.conf /usr/local/etc/salt/minion.d/overrides.conf - run0 qubesctl top.enable dom0 + + qubesctl top.enable $@ + qubesctl --show-output state.apply $@ saltenv=user + qubesctl top.disable $@ From 756da5570e37126ad46f5fcc8d3682c22f49565c Mon Sep 17 00:00:00 2001 From: mustard Date: Tue, 21 Oct 2025 01:14:38 +0200 Subject: [PATCH 07/10] hmmm --- conf/z_user.conf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/conf/z_user.conf b/conf/z_user.conf index aabc9dc..38b5a3a 100644 --- a/conf/z_user.conf +++ b/conf/z_user.conf @@ -15,3 +15,6 @@ pillar_roots: formula_dirs: ['/srv/formulas', '/srv/user/formulas'] +include: + - minion.d/* + - /usr/local/etc/salt/minion.d/*.conf From 9cbf4a7088ef73d701878590a75ff49a73e0516e Mon Sep 17 00:00:00 2001 From: mustard Date: Fri, 24 Oct 2025 18:55:15 +0200 Subject: [PATCH 08/10] makefile change --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index f5fca27..011b97a 100644 --- a/Makefile +++ b/Makefile @@ -75,6 +75,6 @@ apply: install -D -oroot -groot -m0644 conf/z_user.conf /etc/salt/minion.d/z_user.conf install -D -oroot -groot -m0644 conf/overrides.conf /usr/local/etc/salt/minion.d/overrides.conf - qubesctl top.enable $@ - qubesctl --show-output state.apply $@ saltenv=user - qubesctl top.disable $@ + qubesctl top.enable $(ARGS) + qubesctl --show-output state.apply $(ARGS) saltenv=user + qubesctl top.disable $(ARGS) From 4f82e5ab961482807c959019f74975fffec0a7ab Mon Sep 17 00:00:00 2001 From: mustard Date: Fri, 24 Oct 2025 18:59:11 +0200 Subject: [PATCH 09/10] hmmm --- Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index 011b97a..4b16e03 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,16 @@ endif BUNDLEIN := .bundles/qubes-mgmt-salt + +ifeq (apply, $(firstword $(MAKECMDGOALS))) + # use the rest as arguments for "run" + APPLY_ARGS := $(wordlist 2,$(words $(MAKECMDGOALS)),$(MAKECMDGOALS)) + # ...and turn them into do-nothing targets + $(eval $(APPLY_ARGS):;@:) +endif + + + clean-workdir = git init -q -b $* && git diff --quiet && git diff --cached --quiet || (echo 'dirty tree; check git status' && false) .PHONY: guard-domu @@ -71,10 +81,11 @@ install: mkdir -p /srv/user ln -s $(CURDIR)/salt /srv/user/salt +.PHONY: apply apply: install -D -oroot -groot -m0644 conf/z_user.conf /etc/salt/minion.d/z_user.conf install -D -oroot -groot -m0644 conf/overrides.conf /usr/local/etc/salt/minion.d/overrides.conf - qubesctl top.enable $(ARGS) - qubesctl --show-output state.apply $(ARGS) saltenv=user - qubesctl top.disable $(ARGS) + qubesctl top.enable $(APPLY_ARGS) + qubesctl --show-output state.apply $(APPLY_ARGS) saltenv=user + qubesctl top.disable $(APPLY_ARGS) From fb41ae96611cd283e160a2ee6eb0da4e064dfcf0 Mon Sep 17 00:00:00 2001 From: mustard Date: Fri, 24 Oct 2025 19:04:16 +0200 Subject: [PATCH 10/10] a salty change --- salt/salty.sls | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/salt/salty.sls b/salt/salty.sls index 709560b..af19ef9 100644 --- a/salt/salty.sls +++ b/salt/salty.sls @@ -7,3 +7,12 @@ create-template: - prefs: - netvm: "" +create-app: + qvm.vm: + - name: salty-appvm + - present: + - template: super-salty-template + - label: black + - prefs: + - template: super-salty-template + - netvm: ""