Skip to content

Commit

Permalink
Ignore templates
Browse files Browse the repository at this point in the history
  • Loading branch information
clementblaise committed May 25, 2021
1 parent 6b65f50 commit 777ee36
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/ansible/role.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func (role *Role) AllTags() *utils.Set {
return tags
}

// Gather inventory files LoadFromPath a Parent directory
// LoadFromPath Gather inventory files LoadFromPath a Parent directory
// Using a recursive scan. All non inventory files are ignored ( not .ini file )
// All sub parent directory added like label in the inventory
func (role *Role) LoadFromPath(rootPath string) (err error) {
Expand All @@ -55,6 +55,10 @@ func (role *Role) LoadFromPath(rootPath string) (err error) {
return nil
}

if strings.Contains(osPathname, "templates") {
return nil
}

if !strings.Contains(filepath.Base(osPathname), ".yml") {
return nil
}
Expand Down

0 comments on commit 777ee36

Please sign in to comment.