devshorts
devshorts

Reputation: 8872

Why is puppet not finding my environment module path?

I have a simple environment set up with puppet. On the master I have

[root@ak-puppetm develop]# pwd
/etc/puppet/environments/develop

[root@ak-puppetm develop]# puppet config print modulepath --section master --environment develop
/etc/puppet/modules:/usr/share/puppet/modules

[root@ak-puppetm develop]# ls -lah
total 28K
drwxr-xr-x 5 akropp akropp 4.0K Jul 16 15:16 .
drwxr-xr-x 4 akropp akropp 4.0K Jul 16 15:16 ..
-rw-r--r-- 1 akropp akropp 6.1K Jul 16 15:16 .DS_Store
drwxr-xr-x 4 akropp akropp 4.0K Jul 16 15:16 files
drwxr-xr-x 2 akropp akropp 4.0K Jul 16 15:16 manifests
drwxr-xr-x 3 akropp akropp 4.0K Jul 16 15:20 modules

[root@ak-puppetm develop]# ls -lah modules/
total 12K
drwxr-xr-x 3 akropp akropp 4.0K Jul 16 15:20 .
drwxr-xr-x 5 akropp akropp 4.0K Jul 16 15:16 ..
drwxr-xr-x 3 akropp akropp 4.0K Jul 16 15:08 domains
[root@ak-puppetm develop]#

And yet you can see that the module path doesn't seem to contain develop?

If I move my module code to /etc/puppet/modules then puppet finds my classes just fine.

I even tried putting

modulepath=$confdir/environments/$environment/modules:$confdir/modules

Into the puppet.conf but it didn't find it still and just got deprecation warnings instead

My environment though is working, I have a manifest in there and it works great for nodes tagged with the develop environment. Just can't seem to get the modules to pick up

Upvotes: 2

Views: 8334

Answers (2)

Felix Frank
Felix Frank

Reputation: 8223

The global modulepath setting is inconsequential once you switch to environment directories. So the important question is, does

puppet master --configprint environmentpath

yield /etc/puppet/environments.

Update after feedback from the OP:

Since you have not yet activated directory environments, your /etc/puppet/environments/develop does not in fact spawn an actual develop environment. You'd need to define this environment explicitly in puppet.conf, including its manifest and modulepath settings.

Don't do that, though. If your filesystem layout is ready for environment directories, you should add that setting to puppet.conf instead.

[main]
environmentpath=/etc/puppet/environments

Upvotes: 3

iamauser
iamauser

Reputation: 11469

Inside /etc/puppet/environments/develop you need a file name environment.conf. Content of that file can be something similar to this :

modulepath = /etc/puppet/environments/develop/modules:$basemodulepath

Upvotes: 3

Related Questions