-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] salt-ssh does not respect --wipe #61083
Comments
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
Hi, Just to add that this bug means the salt-ssh option
see: salt/salt/client/ssh/__init__.py Line 305 in cf5a19b
|
Can confirm @s-at-ik's observation that |
Regression test for saltstack/salt#62636 and saltstack/salt#61083
Regression test for saltstack/salt#62636 and saltstack/salt#61083
@s0undt3ch |
@vladaurosh If you can confirm this works for you as expected, I'm also willing to come up with a PR + tests since this can be a very nasty issue in some cases. I remember that my fix used to work nicely, but when I tried to come up with a test at a later point in time for a possible PR, it did not anymore. Maybe my test was faulty though. |
Hi @lkubb |
As far as I remember, the fix did not seem to cause the thindir to be absent after execution. I did not put much effort in though, so it's likely I made a mistake somewhere since this small fix worked very nicely before. Which salt version are you testing with? |
Hi @lkubb
Not sure what else I can test. As for version, I am using salt-ssh 3004.1 |
Regression test for saltstack/salt#62636 and saltstack/salt#61083 (cherry picked from commit b3cb195)
Description
Running
salt-ssh --wipe target-id state.apply
does not wipe salt execution environment on the minion. After the command is finished executing, there will still be a directory/var/tmp/.root_<hash>_salt/
containing the whole salt environment withSetup
I'm running salt-ssh on Qubes OS. I extensively debugged this situation and from what I groked, it is a bug in salt-ssh. For the Qubes-specific setup, I temporarily moved /srv/salt/top.sls to top.bak and created a new TemplateVM with
qvm-clone debian-11-minimal someid
to minimize interference. The following files produce this behavior:[/srv/salt/top.sls]
[/srv/salt/teststate.sls]
Steps to Reproduce the behavior
salt-ssh will be called with
-w
option as seen here. It is also possible to pause the execution when the TemplateVM is started (Ctrl+Z) and to log into a salt master VM console by issuingqvm-console-dispvm disp-mgmt-someid
. This let me verify the Qubes-specific behavior by manually debugging the execution/running salt-ssh.Expected behavior
Missing
.root_<hash>_salt
directory.Versions Report
(ran on disp-mgmt-someid with
salt-ssh --versions-report
)salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
I tried to grok what happens (from scratch, this might be quite inaccurate and skips over details) and suspect I found the problem:
salt.client.ssh.Single.run_wfunc
will load minion configuration by calling test.opts_pkg on the minion and save it in opts_pkgself.opts["ssh_wipe"]=True
opts["ssh_wipe"]
defaults to False and the python SHIM doesn't know it is supposed to wipe after executionA simple fix would set
opts_pkg["ssh_wipe"] = self.opts.get("ssh_wipe", False)
here like this:This works in my situation, but I can't know about butterfly effects since I'm not familiar with the architecture as a whole.
The text was updated successfully, but these errors were encountered: