salt: Custom salt modules not loading after sync_all, requires minion restart

Custom salt modules are a bit confusing, and documentation doesn’t explain it well.

For example;

$ cat /srv/salt/base/_modules/hello.py
import salt
def world():
    return "hello world"

$ salt local saltutil.sync_all
local:
    ----------
    grains:
    modules:
        - modules.hello
    outputters:
    renderers:
    returners:
    states:

$ salt local hello.world
local:
    'hello.world' is not available.

For the above to work, I had to restart the minion, which appears to be undocumented.

Any changes to these modules also require a minion restart

Should I send a PR with some better docs, or does this need more thought?

About this issue

  • Original URL
  • State: closed
  • Created 10 years ago
  • Comments: 39 (21 by maintainers)

Most upvoted comments

Guys, I saw the next picture: after creation, when module is updated, but can’t be compiled (.py is present but .pyc is not), it is not displayed by sys.list_modules and can’t be executed.