dpeters/puppet-opsview — Issue #1: opsview_monitored: hosttemplates change on every puppet run, causing Opsview to always reload
Author: antaflos
Created: 2012-02-16 21:27:54+00:00
State: open

I have posted this issue over at cparedes's repo and he directed me here, so here it is again :)

Using Puppet 2.7.10 from apt.puppetlabs.com on Ubuntu 10.04.

The following message appears during every puppet run on any node using the `opsview_monitored` type:

notice: /Stage[main]/Opsview::Puppet::Config/Opsview_monitored[app01]/hosttemplates: hosttemplates changed ['Application - Opsview Client', 'Network - Base', 'OS - Unix Base'] to 'Application - Opsview Client Network - Base OS - Unix Base'

The relevant part of the manifest:

```
class opsview::puppet::config {

...

opsview_monitored { $::hostname:
ensure => 'present',
ip => $::fqdn,
require => [ Class['opsview::puppet::install'], Opsview_hostgroup[$opsview::puppet::hostgroup] ],
hostgroup => $opsview::puppet::hostgroup,
hosttemplates => ['Application - Opsview Client', 'Network - Base', 'OS - Unix Base',],
reload_opsview => true,
}

...
```

This causes Opsview to reload on every puppet run of every node. Obviously this is not practical. Not only is every puppet node markes as "active", there also arise conflicts when two nodes have a simultaneous puppet run. Then Opsview responds with "409 Conflict", because a reload is already in progress. This leads to an error on the node that lost the race for the Opsview reload.

I am not sure why this is happening, but apparently it has something to do with the way arrays are handled between Puppet and JSON? I'd really like to get to the bottom of this but I don't know enough about Ruby or Puppet internals to make any difference. If I can provide any more information please tell me.

Also, thank you (both dpeters and cparedes) for your work on this module. Though it lacks some documentation we had almost no problem getting the basic integration up and running.