Puppet fails to create files

Hi everyone,

I am trying to create an automated installation of icinga agent with puppet but I am failing!
I am getting the following error:

Info: Certificate revocation is disabled, skipping CRL download
Info: Using configured environment 'qa'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Retrieving locales
Info: Loading facts
Info: Caching catalog for c8-agent4.cern.ch
Info: Applying configuration version '1631278668'
Error: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/checker.conf20210910-78644-18ss1z9.lock does not exist or is a dangling symbolic link
Error: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/checker.conf20210910-78644-18ss1z9.lock does not exist or is a dangling symbolic link
Wrapped exception:
No such file or directory - A directory component in /etc/icinga2/features-available/checker.conf20210910-78644-18ss1z9.lock does not exist or is a dangling symbolic link
Error: /Stage[main]/Icinga2::Feature::Checker/Icinga2::Object[icinga2::object::CheckerComponent::checker]/Concat[/etc/icinga2/features-available/checker.conf]/File[/etc/icinga2/features-available/checker.conf]/ensure: change from 'absent' to 'file' failed: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/checker.conf20210910-78644-18ss1z9.lock does not exist or is a dangling symbolic link
Notice: /Stage[main]/Icinga2::Feature::Checker/Icinga2::Feature[checker]/File[/etc/icinga2/features-enabled/checker.conf]: Dependency File[/etc/icinga2/features-available/checker.conf] has failures: true
Warning: /Stage[main]/Icinga2::Feature::Checker/Icinga2::Feature[checker]/File[/etc/icinga2/features-enabled/checker.conf]: Skipping because of failed dependencies
Error: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/mainlog.conf20210910-78644-fkjm5j.lock does not exist or is a dangling symbolic link
Error: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/mainlog.conf20210910-78644-fkjm5j.lock does not exist or is a dangling symbolic link
Wrapped exception:
No such file or directory - A directory component in /etc/icinga2/features-available/mainlog.conf20210910-78644-fkjm5j.lock does not exist or is a dangling symbolic link
Error: /Stage[main]/Icinga2::Feature::Mainlog/Icinga2::Object[icinga2::object::FileLogger::mainlog]/Concat[/etc/icinga2/features-available/mainlog.conf]/File[/etc/icinga2/features-available/mainlog.conf]/ensure: change from 'absent' to 'file' failed: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/mainlog.conf20210910-78644-fkjm5j.lock does not exist or is a dangling symbolic link
Notice: /Stage[main]/Icinga2::Feature::Mainlog/Icinga2::Feature[mainlog]/File[/etc/icinga2/features-enabled/mainlog.conf]: Dependency File[/etc/icinga2/features-available/mainlog.conf] has failures: true
Warning: /Stage[main]/Icinga2::Feature::Mainlog/Icinga2::Feature[mainlog]/File[/etc/icinga2/features-enabled/mainlog.conf]: Skipping because of failed dependencies
Error: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/notification.conf20210910-78644-e8owem.lock does not exist or is a dangling symbolic link
Error: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/notification.conf20210910-78644-e8owem.lock does not exist or is a dangling symbolic link
Wrapped exception:
No such file or directory - A directory component in /etc/icinga2/features-available/notification.conf20210910-78644-e8owem.lock does not exist or is a dangling symbolic link
Error: /Stage[main]/Icinga2::Feature::Notification/Icinga2::Object[icinga2::object::NotificationComponent::notification]/Concat[/etc/icinga2/features-available/notification.conf]/File[/etc/icinga2/features-available/notification.conf]/ensure: change from 'absent' to 'file' failed: Could not set 'file' on ensure: No such file or directory - A directory component in /etc/icinga2/features-available/notification.conf20210910-78644-e8owem.lock does not exist or is a dangling symbolic link
Notice: /Stage[main]/Icinga2::Feature::Notification/Icinga2::Feature[notification]/File[/etc/icinga2/features-enabled/notification.conf]: Dependency File[/etc/icinga2/features-available/notification.conf] has failures: true
Warning: /Stage[main]/Icinga2::Feature::Notification/Icinga2::Feature[notification]/File[/etc/icinga2/features-enabled/notification.conf]: Skipping because of failed dependencies
Warning: /Stage[main]/Icinga2::Service/Service[icinga2]: Skipping because of failed dependencies
Warning: /Stage[main]/Icinga2/Anchor[::icinga2::end]: Skipping because of failed dependencies
Notice: Applied catalog in 17.96 seconds

My manifest for the time being is this one:

class hg_winmonit::agent{

$icinga_source =  $facts['os']['distro']['release']['major']  ? {
    '8' => 'https://packages.icinga.com/epel/icinga-rpm-release-8-latest.noarch.rpm',
    '7' => 'https://packages.icinga.com/epel/icinga-rpm-release-7-latest.noarch.rpm'
  }

  package {'icinga-rpm-release':
    name     => 'icinga-rpm-release',
    provider => 'rpm',
    source   => $icinga_source,
  }

package {'epel-release':
  before => Class['icinga2']
}
->package {'nagios-plugins-all':}


class { 'icinga2':
  manage_package => false,
}

}

I have no clue if I should create those files myself or if they should be created with the installation of the package. Without puppet they are being created during the installation but with puppet I don’t know what should I be expecting.

Env

Centos 8
Puppet version 6.20.0

Every help is appreciated!

Cheers,
Mike