Skip to content

Instantly share code, notes, and snippets.

@ipcrm
Last active December 2, 2017 00:37
Show Gist options
  • Save ipcrm/fb5f955afc36186e0fa4479415d59e97 to your computer and use it in GitHub Desktop.
Save ipcrm/fb5f955afc36186e0fa4479415d59e97 to your computer and use it in GitHub Desktop.
Get list of Profiles or Roles for a given certname (PQL)
puppet query \
'resources[title]{ (title ~ "^Profile*" or title ~ "^Role*" ) and certname = "master.inf.puppet.vm" group by certname,title }'\
| jq '.. | .title?'
```
"Profile::App::Webserver::Apache"
"Profile::App::Webserver::Apache::Php"
"Profile::Platform::Baseline"
"Profile::Platform::Baseline::Linux"
"Profile::Platform::Baseline::Linux::Firewall"
"Profile::Platform::Baseline::Linux::Firewall_post"
"Profile::Platform::Baseline::Linux::Firewall_pre"
"Profile::Platform::Baseline::Linux::Motd"
"Profile::Platform::Baseline::Linux::Packages"
"Profile::Platform::Baseline::Linux::Ssh"
"Profile::Platform::Baseline::Linux::Vim"
"Profile::Platform::Baseline::Users::Linux"
"Profile::Puppet::Master"
"Profile::Puppet::Master::Autosign"
"Profile::Puppet::Master::Fileserver"
"Profile::Puppet::Master::Fileserver::Jdk"
"Profile::Puppet::Master::Fileserver::Tomcat"
"Profile::Puppet::Master::Firewall"
"Profile::Puppet::Master::Gogs"
"Profile::Puppet::Master::Hiera"
"Profile::Puppet::Master::Node_manager"
"Profile::Puppet::Orch_agent"
"Role::Master_server"
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment