... | ... | @@ -753,10 +753,6 @@ query: |
|
|
|
|
|
The currently known values are: `kvm`, `physical`, and `xenu`.
|
|
|
|
|
|
As a bonus, this query will show the number of hosts running each release:
|
|
|
|
|
|
SELECT COUNT(c.certname), value_string FROM factsets fs INNER JOIN facts f ON f.factset_id = fs.id INNER JOIN fact_values fv ON fv.id = f.fact_value_id INNER JOIN fact_paths fp ON fp.id = f.fact_path_id INNER JOIN certnames c ON c.certname = fs.certname WHERE fp.name = 'lsbdistcodename' AND c.deactivated IS NULL GROUP BY value_string;
|
|
|
|
|
|
### Other ways of extracting a host list
|
|
|
|
|
|
* Using the [PuppetDB API][]:
|
... | ... | @@ -782,6 +778,10 @@ As a bonus, this query will show the number of hosts running each release: |
|
|
|
|
|
curl -s -G http://localhost:8080/pdb/query/v4 --data-urlencode 'query=inventory[certname] { facts.os.distro.codename = "bookworm" }' | jq -r ".[].certname"
|
|
|
|
|
|
This will show the number of hosts per Debian release:
|
|
|
|
|
|
curl -s -G http://localhost:8080/pdb/query/v4/fact-contents --data-urlencode 'query=["extract", [["function","count"],"value"], ["=","path",["os","distro","codename"]], ["group_by", "value"]]' | jq
|
|
|
|
|
|
* Using [howto/cumin](howto/cumin)
|
|
|
|
|
|
* Using LDAP:
|
... | ... | |