Puppet Enterprise Classification

extract classification using the restapi

./get_all_groups.sh | jq '.[0]'
Extract only the first occurrence

Script to extract the list of classification and the connected modules from puppet

extract name and classes:

* extract for all the classification
````
root@:~/DEV/script-webconsole # ./get_all_groups.sh | jq '.[] | {name: .name, classes: .classes}'
```

* extract for the first occurrence only
```
./get_all_groups.sh | jq '.[0] | {name: .name, classes: .classes}'
```

* see al the info for the first occurrence
```
./get_all_groups.sh | jq '.[0]'
```

cat get_all_groups.sh

#!/bin/bash
PUPPETMASTER="puppetmaster01.mycompany.net"
PORT="4433"

echo ""
curl --cert /etc/puppetlabs/puppet/ssl/certs/puppetmaster01.bcloud.b-source.net.pem \
     --key  /etc/puppetlabs/puppet/ssl/private_keys/puppetmaster01.bcloud.b-source.net.pem \
     --cacert /etc/puppetlabs/puppet/ssl/certs/ca.pem \
     https://$PUPPETMASTER:$PORT/classifier-api/v1/groups \
     -X GET -H "Content-Type: application/json"
echo ""
echo ""
Salvo diversa indicazione, il contenuto di questa pagina è sotto licenza Creative Commons Attribution-ShareAlike 3.0 License