From 46e7afa3ef8821c6e3b4aa9e579bc19843431ddc Mon Sep 17 00:00:00 2001 From: jeanluc Date: Wed, 6 Dec 2023 17:59:09 +0100 Subject: [PATCH] Fix salt-ssh with saltutil.cmd and in orchestration --- changelog/65670.fixed.md | 1 + salt/client/ssh/client.py | 4 ++++ 2 files changed, 5 insertions(+) create mode 100644 changelog/65670.fixed.md diff --git a/changelog/65670.fixed.md b/changelog/65670.fixed.md new file mode 100644 index 00000000000..54728d69d43 --- /dev/null +++ b/changelog/65670.fixed.md @@ -0,0 +1 @@ +Fixed Salt-SSH pillar rendering and state rendering with nested SSH calls when called via saltutil.cmd or in an orchestration diff --git a/salt/client/ssh/client.py b/salt/client/ssh/client.py index be9247cb157..8727ce23c3c 100644 --- a/salt/client/ssh/client.py +++ b/salt/client/ssh/client.py @@ -39,6 +39,10 @@ class SSHClient: # Salt API should never offer a custom roster! self.opts["__disable_custom_roster"] = disable_custom_roster + # Pillar compilation and nested SSH calls require the correct config_dir + # in __opts__, otherwise we will use the SSH minion's one later. + if "config_dir" not in self.opts: + self.opts["config_dir"] = os.path.dirname(c_path) def sanitize_kwargs(self, kwargs): roster_vals = [