voxpupuli / puppetboard

Web frontend for PuppetDB
https://pypi.org/project/puppetboard/
Apache License 2.0
708 stars 238 forks source link

Noop Reporting #306

Closed johnzimm closed 7 years ago

johnzimm commented 8 years ago

I have a lot of nodes in "noop". Previously they would not show up on the overview unless there were resources that needed to be changed. For "brown field" puppet deployments this is the way I've been easing them into it.

Noops are now shown in the overview as "noop" whether they are changing or not.

Anyone have a good way to only show the ones that are changing on the puppetboard?

I'm currently digging through they python code and puppetdb api to see if I can figure out anything useful.

mterzo commented 7 years ago

When you say used too not show up what version are you compairing to?

johnzimm commented 7 years ago

I'm not sure if the change behavior was something in puppetboard or puppetdb (I've regularly upgraded both). As I get time I'm seeing ways I can maybe work around it or put together a competent pull request in for puppetboard.

But scenario is that I have "noop=true" set in most of my puppet.conf files.

Previously puppetboard would report all nodes with"noop=true" but had no pending changes as "UNCHANGED/GREEN". Those with "noop=true" and pending changes were reported as "CHANGED/BLUE" all the time.

I added a noop column to the inventory so I could see which ones had noop set.

Now it reports all nodes with "noop=true" as "NOOP/ORANGE".

Having an explicit "NOOP/ORANGE" status is helpful in that I no longer have to assume that's what "CHANGED/BLUE" means if it never goes away. But it is unhelpful if nodes with noop set and no pending changes are marked as "UNCHANGED/GREEN" or even "NOOP/GREEN" and left out of the overview screen.

Playing with the puppetdb api a bit there are a couple of relevant key/value pairs:

I'm not sure about the consistency on "latest_report_noop_pending". So assuming a pupet run completes successfully what I am looking for / trying to sort out is basically this:

Basic need is to determine which nodes in noop have changes to be applied and which ones don't

thias commented 7 years ago

I have just deployed Puppetboard for the first time, and I'm seeing the same issue.

Right now, I have only 3 nodes reporting, two RHEL7 and one RHEL6. Their catalogs are quite similar, with no pending changes, yet the two RHEL7 show up as "NOOP/ORANGE" while the RHEL6 shows up as "UNCHANGED/GREEN".

One difference I see looking at the run details for each, is that the "NOOP" ones have "corrective_change" appear under the "Metrics" section, while the "UNCHANGED" one doesn't. All of the rest of "Metrics" is the same. So is the rest of the run, really, with no resources listed in the "Events" section (i.e. no pending changes).

thias commented 7 years ago

I started digging a bit in the code, quickly moved from puppetboard to pypuppetdb, then came across this report : https://github.com/voxpupuli/pypuppetdb/issues/103

The fix was included in September 2016, while the latest pypuppetdb release (0.3.1) that PIP installed for me is from June 2016. So I updated pypuppetdb to git master code and... the problem went away!

mterzo commented 7 years ago

Thanks, I had expected that. I need to validate that it doesn't break with < 4 puppetdb.

johnzimm commented 7 years ago

Verified that installing pypuppetdb from master corrects functionality for me as well. pip uninstall pypuppetdb && pip install git+https://github.com/voxpupuli/pypuppetdb.git@master Using the puppet module for deployment and just executed that within the virtualenv after deployment.

mterzo commented 7 years ago

Working on staging a release of pypuppet.