I have written a simple module and have put the file under <salt_file_roots>/_modules
, the content is more or less:
# foomod.py
def foo(*args):
return {'name': 'foo', 'result': True}
I've run salt minion saltutil.sync_all
, have seen the output with the module I added. I can see that it was synced in minion log as well.
minion:
- modules.foomod
1. I can use it from the minion:
$ salt-call foomod.foo
local:
----------
name:
foo
result:
True
2. I can include it in a state using module.run
and run the state, and it also works.
3. But when I call it from master, this happens:
$ salt minion foomod.foo
minion:
- 'foomod.foo' is not available.
I see the call on minion log as well when I call from master
2014-07-29 15:30:44,290 [salt.minion ][INFO ] User root Executing command foomod.foo with jid 20140729153044256654
2014-07-29 15:30:44,291 [salt.minion ][DEBUG ] Command details {'tgt_type': 'glob', 'jid': '20140729153044256654', 'tgt': 'minion', 'ret': '', 'user': 'root', 'arg': [], 'fun': 'foomod.foo'}
2014-07-29 15:30:44,308 [salt.minion ][INFO ] Returning information for job: 20140729153044256654
So either I skipped the part where I enable this to be run from master directly or I imagined a feature that doesn't exists.
Any help is appreciated.
Answering own question. Salt master had pycrypto==2.6.1
and minion had pycrypto==2.4.1
. Updating it on minion solved it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With