编写自定义剧本插件
自定义的剧本需要实现以下方法:
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:
https://github.com/ssbeatty/vnc_install
编写后放到data/plugin
添加识别成功后可以在剧本添加时找到

Last updated