Last updated 2 years ago
自定义的剧本需要实现以下方法:
type Step interface { ID() string SetID(id string) Exec(session *transport.Session, sudo bool) ([]byte, error) GetSchema() (interface{}, error) Create(conf []byte) (Step, error) Name() string Desc() string Config() interface{} }
同时需要定义一个manifest.yaml
name: vnc_install import: vnc_install
其中name表示唯一的插件名,import表示导入的路径,可以参考go path的导入规则。
详情可见example:
编写后放到data/plugin
data/plugin
添加识别成功后可以在剧本添加时找到