0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-11-09 17:10:41 +00:00

Format go code like the other plugins

This commit is contained in:
Thomas Boerger 2019-09-11 13:51:06 +02:00
parent 441293c20a
commit 851ebcad3d
No known key found for this signature in database
GPG Key ID: 09745AFF9D63C79B

View File

@ -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
}