0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-11-12 16:20:39 +00:00

fix linting

This commit is contained in:
Robert Kaussow 2021-01-26 12:04:27 +01:00
parent 0c507648a9
commit 98579a6657
No known key found for this signature in database
GPG Key ID: 65362AE74AF98B61

View File

@ -21,6 +21,7 @@ host_key_checking = False
` `
type ( type (
// Config for the plugin.
Config struct { Config struct {
Requirements string Requirements string
Galaxy string Galaxy string
@ -59,11 +60,13 @@ type (
BecomeUser string BecomeUser string
} }
// Plugin definition.
Plugin struct { Plugin struct {
Config Config Config Config
} }
) )
// Exec provides the implementation of the plugin.
func (p *Plugin) Exec() error { func (p *Plugin) Exec() error {
if err := p.playbooks(); err != nil { if err := p.playbooks(); err != nil {
return err return err
@ -248,7 +251,7 @@ func (p *Plugin) ansibleCommand(inventory string) *exec.Cmd {
if len(p.Config.ModulePath) > 0 { if len(p.Config.ModulePath) > 0 {
args = append(args, "--module-path", strings.Join(p.Config.ModulePath, ":")) args = append(args, "--module-path", strings.Join(p.Config.ModulePath, ":"))
} }
if p.Config.VaultID != "" { if p.Config.VaultID != "" {
args = append(args, "--vault-id", p.Config.VaultID) args = append(args, "--vault-id", p.Config.VaultID)
} }
@ -256,11 +259,11 @@ func (p *Plugin) ansibleCommand(inventory string) *exec.Cmd {
if p.Config.VaultPasswordFile != "" { if p.Config.VaultPasswordFile != "" {
args = append(args, "--vault-password-file", p.Config.VaultPasswordFile) args = append(args, "--vault-password-file", p.Config.VaultPasswordFile)
} }
for _, v := range p.Config.ExtraVars { for _, v := range p.Config.ExtraVars {
args = append(args, "--extra-vars", v) args = append(args, "--extra-vars", v)
} }
if p.Config.ListHosts { if p.Config.ListHosts {
args = append(args, "--list-hosts") args = append(args, "--list-hosts")
args = append(args, p.Config.Playbooks...) args = append(args, p.Config.Playbooks...)