Some types of custom Salt modules do not work #8634
Labels
affects-4.2
This issue affects Qubes OS 4.2.
C: mgmt
diagnosed
Technical diagnosis has been performed (see issue comments).
P: default
Priority: default. Default priority for new issues, to be replaced given sufficient information.
pr submitted
A pull request has been submitted for this issue.
Milestone
Qubes OS release
4.2 rc4
Brief summary
Custom Salt modules of types that should run on the management DispVM (the "master"), not the target qube, are not present in the environment (I discovered this through outputters, the rest is assumed, but very likely).
Examples for module types that do not/should not work: master tops, outputters, SSH wrapper modules
Steps to reproduce
qubesctl --dom0-only saltutil.sync_all
Expected behavior
Actual behavior
Additional context
The expected behavior above is a 1:1 copy & paste with my fix, but it requires a bit more thought imho.
Usually,
salt-ssh
is run from a Salt master with a permanent cache dir. In Qubes OS, a new DispVM is created for each invocation. Custom modules need to be synced from the fileserver to the cache dir to be available to Salt. Forsalt-ssh
targets, this is done automatically for specific module types (execution modules, states, grains, renderers, returners - the rest is irrelevant). The "master" on the DVM on the other hand would require asalt-run saltutil.sync_all
for any to be synced (salt-run
is not present by default, but can be created easily).Possible fixes:
salt-run
in the management package and makequbes.SaltLinuxVM
runsalt-run saltutil.sync_all
before runningsalt-ssh
salt-call
, onlysalt-run
.salt-run saltutil.sync_all
does in some other way.My current fix puts the
/var/cache/salt/minion/extmods
dir from dom0 into the package that's sent to the management DVM (makes more semantic sense to be in sync with dom0, avoids repeated syncing). Since wrapper modules are interesting from a Qubes perspective (e.g. re #2162) (tops as well btw), I think it would make additional sense toa) provide salt-run by default on dom0 specifically for creating the master
extmods
cache ORb) override the stock
saltutil.sync_all
execution module function to in addition sync those module types to the dom0 minion cache dir,after which they can be sent together with the other configuration and written to
/var/cache/salt/master/extmods
inside the mgmt DVM (the actual fix for this bug).The text was updated successfully, but these errors were encountered: