I want to setup host settings regarding Icinga2 on the puppet master server and I don’t know how to do that. I’m a beginner. I managed to setup foreman / puppet server and the the agent on the Raspi. I can manage the Raspi over foreman. I enable the classes “Icinga2” and “Icingaweb2” and I can now open the Icinga Webinterface.
What I don’t understand is: how do I setup e.g. the DB host for IcingaWeb2 in foreman?
Ok, the question is more about using Puppet within Foreman than about Icinga 2. From what you describe I think you managed to place Puppet classes on the Puppetserver managed by Foreman’s Smart-Proxy and import the classes into Foreman. You also managed to assign them at the host and it is working with the defaults. So the next step would be set the parameters.
Navigate to “Configure > Classes” and select the class, in the tab “Smart Class parameters” you can add a Default value, set the datatype and allow overrides so at host level you can change the value.
You will also need the mysql class and probably some custom puppet code as a ENC for Puppet can only manage classes and nit defined resources.
The question now is: In principal - is this äquivalent? Or do I miss something?
The puppet agent on my host gives me the error:
Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Missing title. The title expression resulted in undef (file: /etc/puppetlabs/code/environments/production/modules/icinga/manifests/ido.pp, line: 83, column: 15) on node raspberrypi.fritz.box
But this error says me almost nothing. I asked also in the Icinga forum. But sadly they are not very responsive…
It’s much easier to understand the error message if you posted the exact module version you have installed. I can only assume you have the latest icinga/icinga module from puppet forge 2.7.1. If that’s the case line 83 is this:
The title is undef, i.e. $ido_package_name has not been defined. It would be defined a few lines before
to either ::icinga2::globals::ido_mysql_package_name or ::icinga2::globals::ido_pgsql_package_name depending on $db_type. So either $db_type is not really set to either mysql or pgsql there or the globals are not defined in the icinga-icinga2 module. That picks up the default value via hiera in this file:
This is how this information should go. But that’s really pure puppet…