Created
February 2, 2021 19:12
-
-
Save slumos/d4ab6749af10ebaf8e15994073ca92d0 to your computer and use it in GitHub Desktop.
puppet query groups.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Main] | |
default: match | |
confdir: $CFGDIR/groups.d | |
autodir: | |
[env] | |
map: puppet query 'nodes[certname] { catalog_environment = "$GROUP" }' | jq -r '.[].certname' | |
list: puppet query 'environments {}' | jq -r .[].name | |
[cluster] | |
map: puppet query 'inventory[certname] { facts.cluster_name ~ "$GROUP" }' | jq -r .[].certname | |
list: puppet query 'facts[value] { name = "cluster_name" group by value }' | jq -r '.[].value' | |
[group] | |
map: cat $CFGDIR/group-$GROUP | |
list: ls -1 $CFGDIR/group-* | sed 's/.*group-//' | |
all: cat $CFGDIR/group-* | |
[match] | |
map: puppet query 'inventory[certname] { certname ~ "$GROUP"}' | jq -r '.[].certname' | |
list: echo certname-regex | |
[profile] | |
map: puppet query 'resources[certname] { type = "Class" and title ~ "(?i)^profile::$GROUP" }' | jq -r .[].certname | |
list: puppet query 'resources[title] { type = "Class" and title ~ "^Profile::" group by title }' | jq -r .[].title | sed 's/^Profile:://' | |
[role] | |
map: puppet query 'resources[certname] { type = "Class" and title ~ "(?i)^Role::$GROUP" }' | jq -r .[].certname | |
list: puppet query 'resources[title] { type = "Class" and title ~ "^Role::" group by title }' | jq -r .[].title | sed 's/^Role:://' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment