在master上创建/srv/salt/_modules/
目录
添加扩展文件
vim /srv/salt/_modules/hello.py
# -*- coding: utf-8 -*-
def create(msg):
return 'Command: "{0}" completed successfully!'.format(msg)
同步模块
salt '*' saltutil.sync_modules
root@ubuntu:/srv/salt# salt 'lvs' hello.create 111
lvs:
Command: "111" completed successfully!