Hi,
I hope this is the right place to start a discussion like this.
I’m curently using the official Sensu puppet module to manage my Sensu Go backend and agents.
My puppet infrastructure is built around the role/profile model.
It seems like such a structure is not supported anymore with the latest version of the Sensu puppet module and it’s forcing me to put module parameters into Hiera directly.
Example:
I have two profiles for, profile::sensu::agent
and profile::sensu::backend
.
On my backend-nodes they’re both included.
And this is what they looked like before upgrading to the latest 4.x version of the module.
# @summary Sensu agent profile
class profile::sensu::agent (
Array $backends = [],
Hash $config = {},
Hash $scripts = {},
) {
class { 'sensu::agent':
backends => $backends,
config_hash => $config,
}
...
}
# @summary Sensu backend profile
class profile::sensu::backend (
String $password,
Hash $checks = {},
...
) {
class { 'sensu::backend':
password => $password,
old_password => 'P@ssw0rd!',
checks => $checks
...
}
}
The agent profile is working fine with version 4.x, the backend profile is causing, errors, though:
- password/old_password was moved to
Class['sensu']
- checks/assets/… was moved to
Class['sensu::resources']
Defining class {'sensu': password => $password, ...}
in the backend doesn’t work, though, because it’s already include
d by sensu::{agent,backend}
.
Defining class {'sensu::resources': checks => $checks, ...}
doesn’t work, either, because it’s already include
d by sensu::{agent,backend}
.
So the only way to migrate my existing profile::sensu::backend
class to be compatible with version 4.x is to just include sensu::backend
and define all class parameters (like sensu::resources::checks
, sensu::password
, …) through Hiera.
Am I missing something?
Is there any way around this (apart from patching the module in horrible ways)?