raise salt.exceptions.SaltClientError
Description of Issue/Question
Setup
(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).) procedure: from salt.client.ssh.client import SSHClient client = SSHClient(c_path='/etc/salt/master') print client.cmd(tgt='192.168.75.175', arg='*',fun='test.ping', salt_user='root', salt_passwd='passwd', roster='scan')
Error: raise salt.exceptions.SaltClientError('salt-ssh could not be run because it could not generate keys.\n\nYou can probably resolve this by executing this script with increased permissions via sudo or by running as root.\nYou could also use the '-c' option to supply a configuration directory that you have permissions to read and write to.') salt.exceptions.SaltClientError: salt-ssh could not be run because it could not generate keys.
You can probably resolve this by executing this script with increased permissions via sudo or by running as root. You could also use the '-c' option to supply a configuration directory that you have permissions to read and write to.
Steps to Reproduce Issue
(Include debug logs if possible and relevant.)
from salt.client.ssh.client import SSHClient client = SSHClient(c_path='/etc/salt/master') print client.cmd(tgt='192.168.75.175', arg='*',fun='test.ping', salt_user='root', salt_passwd='passwd', roster='scan')
Versions Report
(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)
Salt Version:
Salt: 2015.8.8
Dependency Versions: Jinja2: 2.2.1 M2Crypto: Not Installed Mako: 0.3.4 PyYAML: 3.11 PyZMQ: 14.5.0 Python: 2.6.6 (r266:84292, Aug 18 2016, 15:13:37) RAET: Not Installed Tornado: 4.2.1 ZMQ: 4.0.5 cffi: Not Installed cherrypy: 3.2.2 dateutil: Not Installed gitdb: Not Installed gitpython: Not Installed ioflo: Not Installed libgit2: Not Installed libnacl: Not Installed msgpack-pure: Not Installed msgpack-python: 0.4.6 mysql-python: Not Installed pycparser: Not Installed pycrypto: 2.6.1 pygit2: Not Installed python-gnupg: Not Installed smmap: Not Installed timelib: Not Installed
System Versions: dist: centos 6.9 Final machine: x86_64 release: 2.6.32-696.el6.x86_64 system: CentOS 6.9 Final
first, arg would be a list of arguments that are passed on the commandline without keywords
salt-ssh <tgt> state.sls <arg1> <arg2> this=<kwarg1>
since test.ping doesn't need any, you should not be setting arg.
Second, are you running this script with sudo or not?
And third, 2015.8.8 is end of lifed, i would highly recommend upgrading to a newer version.
http://repo.saltstack.com/
Thanks, Daniel
My script is ok when the terminal is running, but it does not work in pychram-ide, but I need to test if the separate salt-master and salt-ssh frameworks can control all the hosts but not the master-minion scheme, Is there a best practice master-ssh document? I am a novice, hoping to get help.
Thanks Robin
We do not really have any best practice documentation.
https://docs.saltstack.com/en/latest/topics/ssh/
ok,thanks
Robin
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.