apply seams to ignore modulepath set in environment.conf

208 views
Skip to first unread message

Malte Finsterwalder

unread,
Nov 3, 2014, 11:35:55 AM11/3/14
to puppet...@googlegroups.com
Hi there,

I have a strange problem that used to work and I can't remember changing anything besides upgrading to newer versions of puppet. I use puppet 3.7.2 now.
And the config and everything looks ok to me.

Here is what happens:
When I execute:
sudo puppet apply -e "include mod::manifest"

I get an Error:
Error: Could not find class mod::manifest for .....

When I give a modulepath, everything works fine:
sudo puppet apply --modulepath /puppet/modules -e "include mod::manifest"

But the same modulepath is also configured in my environment. Here are the config files:

#############################################################################
# /etc/puppet.conf
#############################################################################
[main]
logdir=/var/log/puppet
vardir=/var/lib/puppet
ssldir=/var/lib/puppet/ssl
rundir=/var/run/puppet
factpath=$vardir/lib/facter

environmentpath = $confdir/environments
report=true
pluginsync=true

#############################################################################
# /etc/puppet/environments/production/environment.conf
#############################################################################
manifest=/puppet/manifests
modulepath=/puppet/modules

#############################################################################
# sudo puppet config print | grep module
#############################################################################
module_repository = https://forgeapi.puppetlabs.com
module_working_dir = /var/lib/puppet/puppet-module
module_skeleton_dir = /var/lib/puppet/puppet-module/skeleton
module_groups = 
basemodulepath = /etc/puppet/modules:/usr/share/puppet/modules
modulepath = /puppet/modules


Any ideas what is going wrong?
Like I said, I'm pretty sure this used to work a while ago. Maybe a few month at the most.

Thanks,
   Malte

Felix Frank

unread,
Nov 10, 2014, 7:33:20 PM11/10/14
to puppet...@googlegroups.com
On 11/03/2014 05:35 PM, Malte Finsterwalder wrote:
>
> But the same modulepath is also configured in my environment. Here are
> the config files:
> #############################################################################
> # /etc/puppet/environments/production/environment.conf
> #############################################################################
> manifest=/puppet/manifests
> modulepath=/puppet/modules

Uh, this makes me cringe a bit.

With an

environmentpath=$confdir/environments

and

environment=production

you should really store your modules in

/etc/puppet/environments/production/modules

Then it suffices to specify the manifest directory in environment.conf

manifest=manifests

Note that this is a relative path, as it should be. Don't try and refer
to absolute paths from your environments. This can only lead to pain
down the road.

HTH,
Felix
Reply all
Reply to author
Forward
0 new messages