I am migrating from Puppet 7 to Puppet 8 and runni...
# puppet
r
I am migrating from Puppet 7 to Puppet 8 and running a parallel
puppet8
environment during the transition. Nodes being tested in the
puppet8
environment export
@@nagios_host
resources, but our nagios collector runs in the
production
environment and never sees them since exported resource collection is environment-scoped in PuppetDB. What’s the recommended approach for handling exported resources for nodes temporarily living in a non-production environment? Are there any patterns people use to keep monitoring coverage during a migration like this? Thank you!
Copy code
@@nagios_host {
    $facts['networking']['hostname']:
      ensure  => present,
      address => $facts['networking']['ip'],
      tag     => ['nagios'],
      alias   => $facts['networking']['fqdn'];
  }
j
the closest i ever came to that was during a mass OS upgrade (aka "rebuild every machine") years ago (centos 5 to centos 6 i think?) ... i remember building new puppet and nagios servers on the new OS, and for the rest of the transition period, each machine we rebuilt was purged from the old puppet server and its replacement (with the same hostname, IP, and SSH host keys, but a newer OS installed from scratch) was enrolled with the new puppet server, which added it to the new nagios server
i forget the details but there was some manual step i ended up having to do to make the old nagios server stop monitoring the now-upgraded machines, purging them from the old puppet server wasn't enough to remove them from the nagios server's config files
r
ok, thank you
i
hmm just read this and was kind of thinking.. one could use couchdb as a way to have dynamic inter-environment communications. the export would need to work differently and need a bit of a refactor. But you could have a couchdb acting as a space holding dynamic hiera, and both puppet environments reading from puppetdb. Slowdowns would be pretty close to unnoticeable as couch is crazy fast also using exported resources with for nagios can get kind of grindingly slow in very large environments. Puppet Hiera HTTP Using CouchDB. This might be a bit of a pain to setup and there will no doubt be some ruby involved. But in the end it could very well be a game changer.. just for fun I thought I waould check my thinking against chatgpt and it hallucinated this: crossenv_export::resource { "foo": type => "nagios_service", data => { "host_name" => $facts['networking']['fqdn'], "check_command" => "check_http", } }
🙏 1
r
Thank you! I will look into it!
i
I really like the idea of coding up this solution. It manages to looks both handy and fairly easy. Once I can build VMs again I have a feeling I will be diving in on the idea..
👍 1