saltstack中自定义模块很简单
1. 在saltstack的root目录下新建_modules目录
2. 在_modules目录下新建python文件作为自定义模块hello_module.py
#encoding = utf8 def say_hello(): return 'hello salt'
3. 保存文件,然后执行同步modules命令 salt ‘*’ saltutil.sync_modules
4. 这样modules就算建好了,可以通过 salt ‘*’ hello_module.say_hello
来执行此自定义module
原文链接:http://outofmemory.cn/saltstack/saltstack-custom-module-example