Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installation fails on Debian/Ubuntu wheren configuring the apt keyring #792

Closed
freym opened this issue Sep 11, 2024 · 2 comments
Closed

Comments

@freym
Copy link

freym commented Sep 11, 2024

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7.32.1
  • Ruby:
  • Distribution: Debian/Ubuntu
  • Module version: 6.0.0

How to reproduce (e.g Puppet code you use)

class { 'icinga2': manage_repos => true, }

What are you seeing

When the module tries to install the apt keyring, puppet aborts because the user/group 'nagios' does not exist on the system.

What behaviour did you expect instead

It should install the apt keyring.

Output log

Info: Using environment 'test_icinga2'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Notice: Requesting catalog from
Notice: Catalog compiled by
Info: Caching catalog for
Info: Applying configuration version 'cd50cad411cf3d06febb26c9c7c91d8c206a9484'
Error: Could not find user nagios
Error: /Stage[main]/Icinga::Repos::Apt/Apt::Keyring[icinga.key]/File[/etc/apt/keyrings]/owner: change from 'root' to 'nagios' failed: Could not find user nagios
Error: Could not find group nagios

Any additional information you'd like to impart

I am not a puppet expert but I think the problem is the following:
The module sets the default owner/group for all file resources1. These defaults are apparently used later when configuring the apt keyring directory2. Perhaps it will be enough if this line is executed a little earlier3

Footnotes

  1. https://github.com/voxpupuli/puppet-icinga2/blob/826aad1282a2c039342e274fbc26f9ca1d31d8f0/manifests/config.pp#L26

  2. https://github.com/puppetlabs/puppetlabs-apt/blob/9b6aa36322710bb56b38e6b49b7d8a2d7faa22e8/manifests/keyring.pp#L43

  3. https://github.com/voxpupuli/puppet-icinga2/blob/826aad1282a2c039342e274fbc26f9ca1d31d8f0/manifests/init.pp#L155-L157

@lbetz
Copy link
Contributor

lbetz commented Sep 11, 2024

Hm, never happend here. But the directory '/etc/apt/keyrings' isn't managed by the module puppet-icinga2 neither puppet-icinga.

What kind of version you use for the modules apt and icinga?

The keyring dir is handeld by puppetlabs-apt, see
https://github.com/puppetlabs/puppetlabs-apt/blob/e0b3a5db6abb043f106614dffe341f68d88158ab/manifests/keyring.pp#L43

without any owner or group membership. Is there some code around the class declarition?

@freym
Copy link
Author

freym commented Sep 12, 2024

Sorry my bad. We have set a default in our old Icinga even earlier.

@freym freym closed this as completed Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants