mirror of
https://github.com/thegeeklab/wp-ansible.git
synced 2024-11-25 09:00:39 +00:00
Format go code like the other plugins
This commit is contained in:
parent
441293c20a
commit
851ebcad3d
11
plugin.go
11
plugin.go
@ -173,20 +173,25 @@ func (p *Plugin) vaultPass() error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (p *Plugin) playbooks() error {
|
func (p *Plugin) playbooks() error {
|
||||||
var playbooks []string
|
var (
|
||||||
|
playbooks []string
|
||||||
|
)
|
||||||
|
|
||||||
for _, p := range p.Config.Playbooks {
|
for _, p := range p.Config.Playbooks {
|
||||||
files, err := filepath.Glob(p)
|
files, err := filepath.Glob(p)
|
||||||
// can there be a invalid glob pattern that still is a valid file name?
|
|
||||||
// just add it back to the list and let ansible return error out instead.
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
playbooks = append(playbooks, p)
|
playbooks = append(playbooks, p)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
playbooks = append(playbooks, files...)
|
playbooks = append(playbooks, files...)
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(playbooks) == 0 {
|
if len(playbooks) == 0 {
|
||||||
return errors.New("failed to find playbook files")
|
return errors.New("failed to find playbook files")
|
||||||
}
|
}
|
||||||
|
|
||||||
p.Config.Playbooks = playbooks
|
p.Config.Playbooks = playbooks
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user