0
0
mirror of https://github.com/thegeeklab/wp-ansible.git synced 2024-11-22 10:00:38 +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 { 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
} }