0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-11-24 22:50:39 +00:00
wp-ansible/plugin/plugin.go

65 lines
1.4 KiB
Go
Raw Normal View History

package plugin
import (
2023-12-19 08:19:23 +00:00
wp "github.com/thegeeklab/wp-plugin-go/plugin"
"github.com/urfave/cli/v2"
)
2023-12-19 08:19:23 +00:00
// Plugin implements provide the plugin.
type Plugin struct {
2023-12-19 08:19:23 +00:00
*wp.Plugin
Settings *Settings
}
2023-12-19 08:19:23 +00:00
// Settings for the Plugin.
type Settings struct {
2023-12-22 09:10:39 +00:00
PythonRequirements string
GalaxyRequirements string
Inventories cli.StringSlice
Playbooks cli.StringSlice
Limit string
SkipTags string
StartAtTask string
Tags string
ExtraVars cli.StringSlice
ModulePath cli.StringSlice
Check bool
Diff bool
FlushCache bool
ForceHandlers bool
ListHosts bool
ListTags bool
ListTasks bool
SyntaxCheck bool
Forks int
VaultID string
VaultPassword string
VaultPasswordFile string
Verbose int
PrivateKey string
PrivateKeyFile string
User string
Connection string
Timeout int
SSHCommonArgs string
SFTPExtraArgs string
SCPExtraArgs string
SSHExtraArgs string
Become bool
BecomeMethod string
BecomeUser string
2023-12-19 08:19:23 +00:00
}
func New(options wp.Options, settings *Settings) *Plugin {
p := &Plugin{}
if options.Execute == nil {
options.Execute = p.run
}
2023-12-19 08:19:23 +00:00
p.Plugin = wp.New(options)
p.Settings = settings
return p
}