Hmm, I think the changes with "noop_pending", intoduced in v4.2 (
PDB-2753
) is buggy.
latest_report_noop_pending is set to null even though the last noop run showed changes.
Example: On node foo.bar.com I run 'puppet agent -t --noop'. It shows me there are changes to be made.
In puppetdb however, it looks like this:
curl -X GET http://127.0.0.1:8080/pdb/query/v4/nodes/foo.bar.com
|
{
|
"deactivated" : null,
|
"latest_report_hash" : "114082ba90a7a0fc94580ffa520315d8d1f2723a",
|
"facts_environment" : "production",
|
"cached_catalog_status" : "not_used",
|
"report_environment" : "production",
|
"latest_report_corrective_change" : null,
|
"catalog_environment" : "production",
|
"facts_timestamp" : "2016-09-21T08:33:28.459Z",
|
"latest_report_noop" : true,
|
"expired" : null,
|
"latest_report_noop_pending" : null,
|
"report_timestamp" : "2016-09-21T08:33:31.811Z",
|
"certname" : "foo.bar.com",
|
"catalog_timestamp" : "2016-09-21T08:33:32.601Z",
|
"latest_report_status" : "unchanged"
|
}
|
So...
|
"report_timestamp" : "2016-09-21T08:33:31.811Z" Correct. That's the time I ran the noop.
|
"latest_report_noop" : true Correct, I've run nothing else after the noop.
|
"latest_report_status" : "unchanged" Correct, nothing was changed.
|
"latest_report_noop_pending" : {color:red}null{color} Wrong!
|
I have a cron job that periodically do a noop-run on all my nodes. For nodes that are not "up to date", I get an email report. Also, in PuppetExplorer I list these "nodes with pending jobs" using a query like this:
#report { latest_report?=true and noop=true and status="unchanged" }
|
Since PuppetDB 4.2, this query doesn't work any more.
The problem is that neither of these querys now show me the list of nodes with pending jobs:
#node { latest_report_noop_pending=true }
|
#report { latest_report?=true and noop_pending=true }
|
Is my query wrong, or is there a bug in puppetdb?
(Running the latest puppet on Debian 8.6: puppet-agent 1.6.2-1jessie puppetdb 4.2.2-1puppetlabs1 puppetdb-termini 4.2.2-1puppetlabs1 puppetexplorer 2.0.0-62 puppetlabs-release-pc1 1.1.0-2jessie puppetserver 2.6.0-1puppetlabs1 )
|