Closed shallot closed 10 months ago
I am able to replicate this. One of the great ways to troubleshoot salt-ssh is to run it with -ltrace
. It will show you the exact commands it runs on the minion. I believe this is expected behavior that you are getting a False because salt-ssh runs with salt-call --local
on the minion and can't publish back to a master to refresh pillar data.
But I would like to get @terminalmage 's input here to make sure I am correct on this. I could be wrong and we need to fix this saltutil call for salt-ssh.
My best guess is that this is happening because saltutil.refresh_pillar
fires an event (using event.fire
) on the minion bus so that the minion can asynchronously handle the refresh. The return value for saltutil.refresh_pillar
is the return from the event.fire
, which is True/False based whether or not the minion was successfully able to fire the event on the minion bus. Since salt-ssh has no minion daemon, there is no minion bus, and the event cannot successfully be fired. Hence, a False return.
It's unclear to me why you're running saltutil.refresh_pillar
for salt-ssh in the first place though. Are you not seeing changes to pillar reflected in your salt-ssh calls? As I understand it, salt-ssh compiles pillar for each run, so there should never be a need to refresh it.
@terminalmage all the documentation I encountered that referred to pillars seemed fairly adamant in that you have to run the refresh, no buts. I searched again to verify and saw such references to that in:
https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html
"To ensure that the minions have the new pillar data, issue a command to them asking that they fetch their pillars from the master"
https://docs.saltstack.com/en/latest/topics/pillar/
"This function triggers the minion to asynchronously refresh the in-memory pillar data and will always return None."
"So, if pillar data is modified, and then states are run, the states will see the updated pillar data, but pillar.item, pillar.get, and pillar.raw will not see this data unless refreshed using saltutil.refresh_pillar."
https://docs.saltstack.com/en/latest/topics/development/external_pillars.html
"Just as with traditional pillars, external pillars must be refreshed in order for minions to see any fresh data"
@Ch3LL it would be nice if we didn't have to go all the way to trace
level to get that info with salt-ssh. Maybe if only those messages were bumped up to level debug
in case salt-ssh
was being run, those that mention SALT_ARGV
? It looks like salt/client/ssh/ssh_py_shim.py
shows this on its standard error. Whatever runs that seems to stash that stderr to trace
level?
@shallot All of that applies to minions who run using a master, since pillar is compiled on the master for security. Masterless minions refresh pillar on every run. This is probably something we should document better.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
The docs appear unchanged, this stands
Thank you for updating this issue. It is no longer marked as stale.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.
Thank you for updating this issue. It is no longer marked as stale.
All of that applies to minions who run using a master, since pillar is compiled on the master for security. Masterless minions refresh pillar on every run. This is probably something we should document better.
I am unclear what the specific documentation task is here. Is the ask to update the pillar documentation to mention that masterless minions refresh pill on every run on one of these topics?
https://docs.saltstack.com/en/latest/topics/tutorials/pillar.html https://docs.saltstack.com/en/latest/topics/pillar/ https://docs.saltstack.com/en/latest/topics/development/external_pillars.html
For anyone on this thread, please feel free to clarify the specific action needed to bring this docs issue to a close. Without further clarification, I might need to close this ticket as being unactionable.
closing out enough time has passed and no comments have been made.
Description of Issue/Question
For some reason, with salt-ssh every call to saltutil.refresh_pillar returns False, and I've no idea how to diagnose what's wrong. Is there anything wrong? All of the files do seem to be deployed to the minion.
Adding -l debug to the command line doesn't appear to help - there's a lot of prologue and epilogue added, but no apparent clarification on the core False.
Setup
Steps to Reproduce Issue
Versions Report