Skip to content

Instantly share code, notes, and snippets.

@raphink
Last active September 20, 2018 11:44
Show Gist options
  • Save raphink/23b22c68e7f9c455d31e803798d5e9bc to your computer and use it in GitHub Desktop.
Save raphink/23b22c68e7f9c455d31e803798d5e9bc to your computer and use it in GitHub Desktop.
hierarchies:
- name: "Hostgroups"
mapped_paths: [hostgroup_list, hg, "hostgroups/%{hg}.yaml"]
$hostgroup_split = split($hostgroup, '/')
$hostgroup_list = $hostgroup_split.map |Integer $i, String $p| {
join($hostgroup_split[0,$i+1], '/')
}.reverse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment