voxpupuli / puppet-icingadb

Puppet module to manage IcingaDB.
Apache License 2.0
3 stars 6 forks source link

Duplicate declaration of Icinga::Cert[icingadb tls files for the database client connect] #8

Closed Schillilex closed 1 year ago

Schillilex commented 1 year ago

When you use icingadb::redis with tls parameters like this:

class { 'icingadb::redis':
  bind             => ['127.0.0.1', $::ipaddress],
  use_tls          => true,
  tls_port         => 6380,
  tls_cert_file    => '/etc/icingadb-redis/server.crt',
  tls_key_file     => '/etc/icingadb-redis/server.key',
  tls_cacert_file  => '/etc/icingadb-redis/ca.crt',
  tls_auth_clients => 'yes',
}

you will get a Duplicate Declaration error.

Expected Behavior

icingadb-redis package configures tls settings

Current Behavior

duplicate declaration:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Error while evaluating a Resource Statement, Duplicate declaration: Icinga::Cert[icingadb tls files for the database client connect] is already declared at (file: /etc/puppetlabs/code/modules/icingadb/manifests/config.pp, line: 15); cannot redeclare (file: /etc/puppetlabs/code/modules/icingadb/manifests/redis/config.pp, line: 29) (file: /etc/puppetlabs/code/modules/icingadb/manifests/redis/config.pp, line: 29, column: 5) on node icinga-master.local

Possible Solution

Change the name of the resource /etc/puppetlabs/code/modules/icingadb/manifests/redis/config.pp

icinga::cert { 'icingadb tls files for the database client connect':

to

icinga::cert { 'icingadb-redis tls files for the database client connect':

for example.

    icinga::cert { 'icingadb-redis tls files for the database client connect':
      owner => $user,
      group => $group,
      args  => $tls_files,
    }

Steps to Reproduce (for bugs)

  1. activate use_tls and some other tls options like described in https://forge.puppet.com/modules/icinga/icingadb/reference#icingadbredis
  2. puppet run
  3. --> Duplicate Declaration error

Context

Your Environment