在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!