# Install Icinga server with puppet over foreman?

**URL:** <https://community.icinga.com/t/install-icinga-server-with-puppet-over-foreman/10067>\
**Category:** Automation & Infrastructure\
**Created:** [June 30, 2022, 6:07am UTC](https://community.icinga.com/t/install-icinga-server-with-puppet-over-foreman/10067 "2022-06-30T06:07:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![chr.pie](https://community.icinga.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@chr.pie](https://community.icinga.com/u/chr.pie)\
**Post date:** [June 30, 2022, 6:07am UTC](https://community.icinga.com/t/install-icinga-server-with-puppet-over-foreman/10067/1 "2022-06-30T06:07:46Z")

</div>

Hi!

After a least successful try to install Icinga directly on ubuntu I rethought my requierements and decided to do it the managed way with puppet. I have now a running puppet master and I wanted to install an Icinga2 server including Icingaweb2 and director over foreman. I created an external Postgresql server and installed the IDO feature with the manual and also created an icinga database plus user. I also installed these modules on the puppet master server:

- [puppet-icinga](https://github.com/Icinga/puppet-icinga)
- [puppet-icinga2](https://github.com/Icinga/puppet-icinga2)
- [puppet-icingaweb2](https://github.com/Icinga/puppet-icingaweb2)

I then added the host to puppet and assigned these Puppet classes and the overrid the values below:

 ![grafik](https://community.icinga.com/uploads/default/original/2X/5/566b71227b3c2233195749eef095ac2d82a3df1c.png)

The _ticket\_salt_ is an incomplete task (and I don’t have a clue at the moment how to manage this). Beside that Icingaweb2 is accessible but it is not configured until now:

 ![grafik](https://community.icinga.com/uploads/default/original/2X/a/a0909deff6e55f01f63335f7dc78c6dc746314f9.png)

With these settings, puppet tells me **this** on the host:

```auto
root@raspberrypi:/home/pi# puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Warning: Found multiple default providers for service: init, systemd; using init
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
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

```

This error message confuses me. I’ve looked into the ido.pp. At line 83 this is writte

```auto
    package { $ido_package_name:
      ensure => installed,
      before => Class["icinga2::feature::ido${db_type}"],
    }

```

So it seems that $ido\_package\_name is missing.

Some lines before this is stated:

```auto
    $ido_package_name = $db_type ? {
      'mysql' => $::icinga2::globals::ido_mysql_package_name,
      'pgsql' => $::icinga2::globals::ido_pgsql_package_name,
    }

```

So I thought that db\_type in icinga::ido is the problem. But I defined that in the parameters.  
How should I continue? I’m a little bit lost at the moment…

Christoph

---

<div class="post-metadata">

**Author:** ![chr.pie](https://community.icinga.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@chr.pie](https://community.icinga.com/u/chr.pie)\
**Post date:** [July 2, 2022, 11:15am UTC](https://community.icinga.com/t/install-icinga-server-with-puppet-over-foreman/10067/2 "2022-07-02T11:15:15Z")

</div>

So does anybody know how to do that? Is there any guide for this? Is unclear to me which classes I should include and how they should be configured. I think that’s Icinga-knowledge (the less puppet knowledge).

Can anybody perhaps share hers/his configuration?

Thanks, Christoph

---

<div class="post-metadata">

**Author:** ![chr.pie](https://community.icinga.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@chr.pie](https://community.icinga.com/u/chr.pie)\
**Post date:** [July 8, 2022, 5:37am UTC](https://community.icinga.com/t/install-icinga-server-with-puppet-over-foreman/10067/3 "2022-07-08T05:37:15Z")

</div>

Nobody? Is there a better place to ask?  
Normally I would say no. But this forum seems to be not very responsive 😑

---

<div class="post-metadata">

**Author:** ![lbetz1](https://community.icinga.com/letter_avatar_proxy/v4/letter/l/65b543/32.png) [@lbetz1](https://community.icinga.com/u/lbetz1)\
**Post date:** [August 22, 2022, 6:23am UTC](https://community.icinga.com/t/install-icinga-server-with-puppet-over-foreman/10067/4 "2022-08-22T06:23:50Z")

</div>

Hi Christoph,

I suspect it is due to the order in which the classes are processed. If icinga::ido is declared before icinga::server, variable $::icinga2::globals::ido\_pgsql\_package\_name is undefined and so is the title in line 83.  
A meaningful error message is missing here, I’ll include that.

My recommendation is also to use Foreman only as ENC for roles, without parametrization and do everything else in Hiera and related profile and role classes. See [The roles and profiles method](https://puppet.com/docs/pe/2019.8/osp/the_roles_and_profiles_method.html).

The classes from the icinga/icinga module are in principle already such profile classes.

Bye  
Lennart

---

<div class="post-metadata">

**Author:** ![chr.pie](https://community.icinga.com/letter_avatar_proxy/v4/letter/c/d9b06d/32.png) [@chr.pie](https://community.icinga.com/u/chr.pie)\
**Post date:** [November 11, 2022, 5:22pm UTC](https://community.icinga.com/t/install-icinga-server-with-puppet-over-foreman/10067/5 "2022-11-11T17:22:23Z")

</div>

Hmm. I’m still trying to get that working. But it seems to be not straightforward.

Is there a guide for setup Icinga over Foreman?
