I'm reopening the issue we discovered in #37580 with a minimal reproducer. \cc @isbm
sshd
configured & runningOn the 1st system:
file_roots:
base:
- /srv/salt/
myhost:
host: myhostfqdn
user: root
passwod: mypass
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import logging
import salt.modules.cmdmod
__salt__ = {
'cmd.run_all': salt.modules.cmdmod.run_all,
}
log = logging.getLogger(__name__)
def __virtual__():
return True
def get_me_stuff():
result = {"status": "ok"}
return result
state:
module.run:
- name: mymodule.get_me_stuff
salt-ssh -i myhost state.apply my.state
-> succeedssalt-ssh -i myhost saltutil.sync_modules
-> empty outputsalt-ssh -i myhost state.apply my.state
-> fails nowThe last command fails, until we delete the extracted thin in the temp of the
target system (-w
parameter as suggested in the older issue doesn't help). After the 1st command execution, the mymodule.py
is present in extracted thin on the target system, but running sync_modules
deletes it and it's not copied again by running the last state.apply.
Salt Version:
Salt: 2016.3.4
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: 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: 2.7.12 (default, Jun 28 2016, 06:57:42) [GCC]
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.2.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.2
System Versions:
dist: SuSE 42.2 x86_64
machine: x86_64
release: 4.1.34-33-default
system: Linux
version: openSUSE 42.2 x86_64
This is a bug. While sync_modules
has zero sense on Salt SSH, as there are nothing to sync with, yet it should no-op. Otherwise you would need to do endless if/else in your templates.
We should fix this for sure.
However, for now do not use sync_modules
. :laughing:
Looks like I am able to replicate this. We should definitely get this fixed up. As @isbm explained we don't need to use sync_modules but definitely should not be having issues when running the module.
@Ch3LL I will look at this.
@Ch3LL could you please assign me here?
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.
Most helpful comment
@Ch3LL I will look at this.