The default install of puppet-agent on Debian 12 lacks augeas support.
See bottom of report for my workaround.
Story
When running puppet agent -t
on a Debian 12 machine, I get the following error:
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
root@baz:~#
Steps to Reproduce
I have installed a brand new Debian 12 (bookworm) machine
(it is an EC2 instance in AWS, based on the official Debian 12 AMI from Debian).
Since the puppet-agent
.deb package 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 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, 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 any 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". (see example run at the top).
Additional Context
Package: puppet-agent
Version: 7.23.0-1
I also tried this:
apt install augeas-tools
apt install puppet-module-puppetlabs-augeas-core
apt install puppet-module-camptocamp-augeas
apt install libaugeas-dev
reboot
...but it is still the same.
During my debugging I found that on my Deb11 machines, augeas seem to be installed here:
/opt/puppetlabs/puppet/vendor_modules/augeas_core/
Also I see that no .deb libs or packages are installed:
dpkg -l | grep aug
Also if I run puppet module list
it says no module installed:
/etc/puppetlabs/code/environments/production/modules (no modules installed)
/etc/puppetlabs/code/modules (no modules installed)
/opt/puppetlabs/puppet/modules (no modules installed)
...so I'm not sure how and where puppet agent actually manages to find the augeas functions.
Perhaps via puppet config print vendormoduledir
= /opt/puppetlabs/puppet/vendor_modules
?
Compared to the Deb12 machine:
Augeas seem to be installed here:
/usr/share/puppet/modules.available/puppetlabs-augeas-core/
Libs and packages are installed. Example from before I manually try to add additional packages:
root@baz:~# dpkg -l | grep aug
ii augeas-lenses 1.14.0-1 all Set of lenses needed by libaugeas0 to parse config files
ii libaugeas0:amd64 1.14.0-1 amd64 Augeas configuration editing library and API
ii ruby-augeas 1:0.5.0+gem-1 amd64 Augeas bindings for the Ruby language
root@baz:~#
...and after I added the additional packages:
root@baz:~# dpkg -l | grep aug
ii augeas-lenses 1.14.0-1 all Set of lenses needed by libaugeas0 to parse config files
ii augeas-tools 1.14.0-1 amd64 Augeas command line tools
ii libaugeas-dev:amd64 1.14.0-1 amd64 Development files for writing applications based on libaugeas0
ii libaugeas0:amd64 1.14.0-1 amd64 Augeas configuration editing library and API
ii puppet-module-camptocamp-augeas 1.9.0-2 all Puppet module for Augeas
ii puppet-module-puppetlabs-augeas-core 1.1.2-1 all Puppet module for Augeas Core
ii ruby-augeas 1:0.5.0+gem-1 amd64 Augeas bindings for the Ruby language
root@baz:~#
If I run puppet module list
it says the module installed, but apparently it is not found/used since I get that error.
root@baz:~# puppet module list
/usr/share/puppet/modules
└── puppetlabs-augeas_core (v1.1.2)
root@baz:~#
If I run puppet config print vendormoduledir
on Deb12 I get /usr/share/puppet/vendor_modules
.
Now, when writing this report, I thought: what if I put a symlink to that augeas_core module in the vendor_modules dir?
root@baz:~# cd /usr/share/puppet/vendor_modules
root@baz:/usr/share/puppet/vendor_modules# ln -s /usr/share/puppet/modules.available/puppetlabs-augeas-core
root@baz:/usr/share/puppet/vendor_modules# puppet agent -t--noop
Info: Using environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Loading facts
Info: Applying configuration version '219979d0'
--- /etc/default/puppet 2023-02-10 15:54:26.000000000 +0100
+++ /etc/default/puppet.augnew 2023-12-07 15:54:41.901167922 +0100
@@ -2,3 +2,4 @@
# Startup options
DAEMON_OPTS=""
+START=yes
Notice: /Stage[main]/Profiles::Puppetnode/Augeas[/etc/default/puppet: enable puppet daemon]/returns: current_value 'need_to_run', should be 0 (noop)
Notice: Applied catalog in 1.94 seconds
root@baz:/usr/share/puppet/vendor_modules#
Wheee! It worked.
I leave it to you to find the correct solution to this, if this is a bug.
If not, should I have run some special command to "register" that available module?