首页 > IT职业 > IT职场 > saltstack自定义模块示例
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
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3278/viewspace-2805528/ ,如需转载,请注明出处,否则将追究法律责任。