Crates.io | rust-puppetdb-cli |
lib.rs | rust-puppetdb-cli |
version | 0.1.2 |
source | src |
created_at | 2016-03-03 19:41:14.493821 |
updated_at | 2016-03-08 20:19:29.698412 |
description | PuppetDB CLI tool in rust. |
homepage | |
repository | https://github.com/ajroetker/rust-puppetdb-cli |
max_upload_size | |
id | 4361 |
size | 19,943 |
This CLI is compatible with PuppetDB v4.
Using rustc
and cargo
(stable, beta, or nightly):
<rust-puppetdb-cli>$ export PATH=./target/debug
<rust-puppetdb-cli>$ cargo build
<rust-puppetdb-cli>$ puppet-query 'nodes[certname]{}'
[
{
"certname" : "baz.example.com"
},
{
"certname" : "bar.example.com"
},
{
"certname" : "foo.example.com"
}
]
<rust-puppetdb-cli>$ puppet-db status
{
"puppetdb-status": {
"service_version": "4.0.0-SNAPSHOT",
"service_status_version": 1,
"detail_level": "info",
"state": "running",
"status": {
"maintenance_mode?": false,
"queue_depth": 0,
"read_db_up?": true,
"write_db_up?": true
}
},
"status-service": {
"service_version": "0.3.1",
"service_status_version": 1,
"detail_level": "info",
"state": "running",
"status": {}
}
}
The Rust PuppetDB CLI accepts a --config=<path_to_config>
flag which allows
you to configure your ssl credentials and the location of your PuppetDB.
By default the tool will use $HOME/.puppetlabs/client-tools/puppetdb.conf
as
it's configuration file if it exists.
The format of the config file can be deduced from the following example.
{
"puppetdb" : {
"server_urls" : [
"https://pdb.internal.lan:8081",
"https://read-pdb.internal.lan:8081"
],
"cacert" : "/path/to/cacert",
"cert" : "/path/to/cert",
"key" : "/path/to/private_key"
},
}
}
--log-level
and --silent
options