You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
Running salt-ssh does not load the Saltfile, and when specified on the CLI as a relative path it also doesn't load it.
When specifying the full path, it gets loaded, but the configuration inside is not expanded and the entire point of the Saltfile is moot.
Steps to Reproduce the behaviour
After installation and configuration setup:
Run a test.ping: salt-ssh somehost1234 test.ping
Returns: OSError: Roster file "/etc/salt/roster" not found
Manually specify Saltfile, run the same command: salt-ssh --saltfile=Saltfile somehost1234 test.ping
Returns: salt-ssh: error: 'Saltfile' file does not exist.
Manually specify Saltfile using the full path, run the same command: salt-ssh --saltfile=/Users/me/salt-ssh-bug/Saltfile somehost1234 test.ping
Returns: OSError: Roster file "./roster" not found
If I take all the paths that are referenced anywhere, and replace them with static full paths, it almost works, but it can't create keys:
salt-ssh could not be run because it could not generate keys.
I don't know in what location it is trying to create the keys, all paths are set to be the local directory I'm currently in, but I suspect that either it is being sandboxed, or it is still trying to write to somewhere in /etc, which is not what I want it to do.
Expected behavior
Consume and produce from the local directory. So when I execute salt-ssh it should read the Saltfile in the directory I am in, and either assume the relative paths are relative to the current working directory or relative to the Saltfile.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 3007.1Python Version:
Python: 3.10.14 (main, Apr 3 2024, 21:27:26) [Clang 15.0.0 (clang-1500.0.40.1)]Dependency Versions:
cffi: 1.16.0cherrypy: unknowndateutil: 2.8.2docker-py: Not Installedgitdb: Not Installedgitpython: Not InstalledJinja2: 3.1.4libgit2: Not Installedlooseversion: 1.3.0M2Crypto: Not InstalledMako: Not Installedmsgpack: 1.0.7msgpack-pure: Not Installedmysql-python: Not Installedpackaging: 23.1pycparser: 2.21pycrypto: Not Installedpycryptodome: 3.19.1pygit2: Not Installedpython-gnupg: 0.5.2PyYAML: 6.0.1PyZMQ: 25.1.2relenv: 0.16.0smmap: Not Installedtimelib: 0.3.0Tornado: 6.3.3ZMQ: 4.3.4Salt Package Information:
Package Type: onedirSystem Versions:
dist: darwin 23.5.0 locale: utf-8machine: arm64release: 23.5.0system: Darwinversion: 14.5 arm64
Additional context
This used to work with whatever version was current in 2022 (the internal repo where this configuration is stored was last committed to in 2022 and passed tests back then).
The text was updated successfully, but these errors were encountered:
Description
Running salt-ssh does not load the Saltfile, and when specified on the CLI as a relative path it also doesn't load it.
When specifying the full path, it gets loaded, but the configuration inside is not expanded and the entire point of the Saltfile is moot.
I know about the other issue about path expansion (#66588), and the docs at https://docs.saltproject.io/en/latest/topics/ssh/index.html#define-cli-options-with-saltfile that do not align with reality, but the issue seems to happen with 3007.1 and 3007.0 all the same.
Setup
Installed salt using the official package (via Homebrew) on macOS. Also try manual install just to be sure (via https://repo.saltproject.io/salt/py3/macos/minor/3007.1/salt-3007.1-py3-arm64.pkg)
Created a Saltfile, a roster and a directory structure to hold my states and pillars etc.
Structure looks like this
(Relative path in my home directory). ├── Saltfile ├── env │ ├── base │ │ └── formula │ └── prod │ ├── pillar │ └── state ├── log ├── master ├── roster └── var ├── cache │ └── salt └── log └── salt
Saltfile looks like this:
roster looks like this
master looks like this
Steps to Reproduce the behaviour
After installation and configuration setup:
Run a test.ping:
salt-ssh somehost1234 test.ping
Returns:
OSError: Roster file "/etc/salt/roster" not found
Manually specify Saltfile, run the same command:
salt-ssh --saltfile=Saltfile somehost1234 test.ping
Returns:
salt-ssh: error: 'Saltfile' file does not exist.
Manually specify Saltfile using the full path, run the same command:
salt-ssh --saltfile=/Users/me/salt-ssh-bug/Saltfile somehost1234 test.ping
Returns:
OSError: Roster file "./roster" not found
If I take all the paths that are referenced anywhere, and replace them with static full paths, it almost works, but it can't create keys:
salt-ssh could not be run because it could not generate keys.
I don't know in what location it is trying to create the keys, all paths are set to be the local directory I'm currently in, but I suspect that either it is being sandboxed, or it is still trying to write to somewhere in /etc, which is not what I want it to do.
Expected behavior
Consume and produce from the local directory. So when I execute salt-ssh it should read the Saltfile in the directory I am in, and either assume the relative paths are relative to the current working directory or relative to the Saltfile.
Versions Report
salt --versions-report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)Additional context
This used to work with whatever version was current in 2022 (the internal repo where this configuration is stored was last committed to in 2022 and passed tests back then).
The text was updated successfully, but these errors were encountered: