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

Puppet agent on Debian 12 don't find installed modules #2445

Closed
elofu17 opened this issue Dec 12, 2023 · 3 comments
Closed

Puppet agent on Debian 12 don't find installed modules #2445

elofu17 opened this issue Dec 12, 2023 · 3 comments
Labels
bug Something isn't working

Comments

@elofu17
Copy link

elofu17 commented Dec 12, 2023

The default install of puppet-agent v7 on Debian 12 lack builtin support for stuff we're used to, like augeas, sshkeys, etc.

And when you manually install these core packets (apt install puppet-module-puppetlabs-augeas-core; apt install puppet-module-puppetlabs-sshkeys-core, etc) they do list as installed with puppet module list, but they are not found.

Workaround: For some reason, adding a symlink to the module(s) in /usr/share/puppet/vendor_modules/ make puppet-agent find them.


When running puppet agent -t on a Debian 12 machine, I get errors like this:

root@baz:~# puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Error: Failed to apply catalog: Resource type 'Augeas' was not found

or

Error: Failed to apply catalog: Resource type 'Ssh_authorized_key' was not found

Steps to Reproduce

Installed a brand new Debian 12 (bookworm) machine
Since the puppet-agent .deb package (v7) now seem to be located in the official Debian APT repo, I have not added any custom APT source.
(comparison: on my Debian 11 machines I have /etc/apt/sources.list.d/puppet7.list : deb http://apt.puppetlabs.com bullseye puppet7)

echo 'APT::Install-Recommends "0";' > /etc/apt/apt.conf.d/01_no_recommends
apt update && apt -y full-upgrade
apt -y install puppet-agent

mkdir /var/lib/puppet
echo -e 'vardir = /var/lib/puppet\nssldir = /var/lib/puppet/ssl\nserver = puppet-master2.foo.bar' > /etc/puppet/puppet.conf
puppet ssl bootstrap 
  <I now get a signed cerificate>

I declare the node baz.foo.bar in nodes.pp and assign a profile.
As long as the profile and manifest don't contain any augeas calls (or ssh-keys, etc), everything is working fine:

root@baz:~# puppet agent -t
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Caching catalog for baz.foo.bar
Info: Applying configuration version 'ea40e02a'
<...doing my changes...>
Notice: Applied catalog in 3.05 seconds
root@baz:~#

But if I add a augeas call - for example:

  augeas { '/etc/default/puppet: enable puppet daemon':
    changes => [
      'set /files/etc/default/puppet/START yes',
      ],
  }

...then puppet-agent immediately bail with "Error: Failed to apply catalog: Resource type 'Augeas' was not found".

Additional Context

Package: puppet-agent
Version: 7.23.0-1


The homepage for augeas_core (https://forge.puppet.com/modules/puppetlabs/augeas_core/readme) says:

Setup Requirements:
The augeas libraries and ruby bindings must be installed in order to use this module.
If you are using puppet-agent packages, then those prerequisites are already satisfied for most platforms.

So for Debian 12, that last sentence don't really apply right now.

To make puppet-agent work the way I'm used to, I currently have to run:

apt install puppet-module-puppetlabs-augeas-core
ln -s /usr/share/puppet/modules.available/puppetlabs-augeas-core /usr/share/puppet/vendor_modules/
apt install puppet-module-puppetlabs-sshkeys-core
ln -s /usr/share/puppet/modules.available/puppetlabs-sshkeys-core /usr/share/puppet/vendor_modules/
...and so on...

I guess you should do something like the following to solve this issue:

1
In the puppet-agent .deb package, perhaps you should add those core modules (like puppet-module-puppetlabs-augeas-core) as Depends.

Ok, now the module is installed, but this is not enough.
Because even though puppet module list show that it is installed...

root@baz:~# puppet module list
/usr/share/puppet/modules
└── puppetlabs-augeas_core (v1.1.2)

...apparently it is not found since we get the "'Augeas' was not found" message.

2
I assume the module "registration" is done correctly when the above package is installed (it is located here: /usr/share/puppet/modules/augeas_core -> /etc/alternatives/puppet-module-augeas-core -> /usr/share/puppet/modules.available/puppetlabs-augeas-core).

So the bug must be in 'puppet-agent'. It need to be fixed to find and use the installed module somehow.
Exactly how is up to you. Using the vendor_modules dir is just my workaround.

@joshcooper
Copy link
Contributor

joshcooper commented Dec 13, 2023

@elofu17 please do not file tickets against Debian maintained puppet-agent package here. We do not support Debian 12 yet, so I'm going to close this. Follow puppetlabs/puppet#9149 for updates.

@joshcooper
Copy link
Contributor

It looks like the issue with core modules missing from Debian maintained puppet-agent packages is already filed as https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1056355

@elofu17
Copy link
Author

elofu17 commented Dec 14, 2023

Ah! Sorry, I didn't realize they are two separate projects.

Thanks. Yes, 1056355 looks like the same bug I reported here.

Question:
Why are there a Debian maintained version as well as a puppetlabs maintained version? (and the two are non-compatible)
What are the pros/cons? I.e. which one should I use on all future Debian 12, 13, 14... machines?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants