Using the puppet gem on an unsupported platform

126 views
Skip to first unread message

Mark Dixon

unread,
Mar 10, 2021, 10:22:50 AM3/10/21
to Puppet Users

Hi there,

Following on from the conversation about the availability of a puppet agent RPM on el8 for the ppc64le architecture, I'm trying to use agent in the version of puppet made available as a ruby gem.

It largely works just by doing this, giving me puppet 7.4.1:

  yum install ruby
  gem install puppet

However, its "mount" resource provider doesn't appear to do anything. I tried reproducing this on el8 /x86_64: "mount" resources worked under the puppet agent rpm, but not under the puppet agent from the gem.

Is this related to the movement of "mount" into the "mount_core" module? There isn't an obvious extra gem to install, and I tried a "puppet module install puppetlabs-mount_core" on the client (but suspect that's only a useful command on the server!)

Any ideas on how to get the mount resource working for the puppet gem, please?

Thanks,

Mark

Martin Alfke

unread,
Mar 11, 2021, 2:04:06 AM3/11/21
to puppet...@googlegroups.com
Hi Mark,

please check module path using 'puppet config print modulepath' and install the required core modules into one of the mentioned folders:
puppet module install puppetlabs-mount_core --target-dir <path>

This should make the mount resource type available.

Best,
Martin

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/362ba8fc-9dc3-4929-a500-70123de399ecn%40googlegroups.com.

Mark Dixon

unread,
Mar 11, 2021, 12:11:09 PM3/11/21
to Puppet Users
Hi Martin,

Thanks - but that doesn't seem to be the problem, as it's already in the modulepath. Just noticed something odd, will prod a bit more (unfortunately next week now).

Best,

Mark

Martin Alfke

unread,
Mar 12, 2021, 2:52:43 AM3/12/21
to puppet...@googlegroups.com
Hi Mark,

You can check if a type is available by running puppet describe -l
This will print out all available puppet custom types.

Best,
Martin


Mark Dixon

unread,
Mar 18, 2021, 12:47:05 PM3/18/21
to Puppet Users
Thanks for that, it's showing just how weird things are getting!

puppet 7.4.1, puppetserver 7.0.3. I have this fragment in the default node definition in my site.pp on the server:
```
   notify { "here!": }
   mount { "/tmp/foo":
      ensure => defined,
      device => "/dev/shm",
      fstype => "tmpfs",
   }
```

Just installing the puppet gem on the client, I see a short list of resource types without mount:
```
# puppet describe -l
These are the types known to puppet:
exec            - Executes external commands
file            - Manages files, including their content, owner ...
filebucket      - A repository for storing and retrieving file  ...
group           - Manage groups
notify          - Sends an arbitrary message, specified as a st ...
package         - Manage packages
resources       - This is a metatype that can manage other reso ...
schedule        - Define schedules for Puppet
service         - Manage running services
stage           - A resource type for creating new run stages
tidy            - Remove unwanted files based on specific crite ...
user            - Manage users
whit            - Whits are internal artifacts of Puppet's curr ...
```

Applying the catalog doesn't do anything useful (expected), but doesn't trigger an error either (unexpected).

The mount resource shows up after installing mount_core on the client, but applying the catalog still doesn't do anything useful:
```
# puppet module install puppetlabs-mount_core
Notice: Preparing to install into /etc/puppetlabs/code/modules ...
Notice: Downloading from https://forgeapi.puppet.com ...
Notice: Installing -- do not interrupt ...
/etc/puppetlabs/code/modules
└── puppetlabs-mount_core (v1.0.4)
# puppet describe -l | grep mount
mount           - Manages mounted filesystems, including puttin ...
# puppet agent --no-daemonize --onetime --detailed-exitcodes --verbose
Info: Using configured environment 'production'
Info: Retrieving pluginfacts
Info: Retrieving plugin
Info: Caching catalog for foobar.local
Info: Applying configuration version '1616085285'
Notice: here!
Notice: /Stage[main]/Main/Node[default]/Notify[here!]/message: defined 'message' as 'here!'
Notice: Applied catalog in 1.19 seconds
# grep foo /etc/fstab
#
```

Whereas copying the fragment into a foo.pp file on the client and applying it locally *does* do something useful:
```
# puppet apply foo.pp
Notice: Compiled catalog for foobar.local in environment production in 0.06 seconds
Notice: here!
Notice: /Stage[main]/Main/Notify[here!]/message: defined 'message' as 'here!'
Notice: /Stage[main]/Main/Mount[/tmp/foo]/ensure: defined 'ensure' as 'defined'
Notice: /Stage[main]/Main/Mount[/tmp/foo]: Triggered 'refresh' from 1 event
Notice: Applied catalog in 0.11 seconds
# grep foo /etc/fstab
/dev/shm        /tmp/foo        tmpfs   defaults        0       0
```

I note that the catalog adds the mount as expected if puppet is installed via an rpm from the puppetlabs site.

Anyone know why this is working in `puppet apply` but not `puppet agent` when installed via a gem, please?

Thanks,

Mark

Martin Alfke

unread,
Mar 19, 2021, 3:50:54 AM3/19/21
to puppet...@googlegroups.com
Hi Mark,

Have you installed the puppet mount core module only on the agent or also on the master?
Usually you install modules only on the master and all resource types get synced to all agents.

You need the module on the agent if you want to run puppet apply only.

Hth,
Martin


Mark Dixon

unread,
Mar 19, 2021, 5:22:35 AM3/19/21
to Puppet Users
Hi Martin,

Installing mount_core on the server did the trick - thanks.

As mount_core is distributed with the agent in packages for supported operating systems, I imagined I needed to do something similar for the gem version. Clearly not! Hope this won't confuse clients using the packages...

Best,

Mark
Reply all
Reply to author
Forward
0 new messages