mirror of
https://github.com/thegeeklab/wp-ansible.git
synced 2024-11-21 23:50:40 +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 {
|
||||
var playbooks []string
|
||||
var (
|
||||
playbooks []string
|
||||
)
|
||||
|
||||
for _, p := range p.Config.Playbooks {
|
||||
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 {
|
||||
playbooks = append(playbooks, p)
|
||||
continue
|
||||
}
|
||||
|
||||
playbooks = append(playbooks, files...)
|
||||
}
|
||||
|
||||
if len(playbooks) == 0 {
|
||||
return errors.New("failed to find playbook files")
|
||||
}
|
||||
|
||||
p.Config.Playbooks = playbooks
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user