puppet not respect basemodulepath

191 views
Skip to first unread message

李逸超

unread,
Aug 14, 2014, 4:35:37 AM8/14/14
to puppet...@googlegroups.com
$ cat /etc/puppet/puppet.conf
[main]
environmentpath = $confdir/environments
basemodulepath = $confdir/environments/$environment/dist

$ sudo puppet config print modulepath --environment datanode
/etc/puppet/environments/datanode/modules:/etc/puppet/environments/datanode/dist

$ ls ~/puppet
Puppetfile README.md  dist       manifests

$ ls /etc/puppet
auth.conf            autosign.conf  environments  manifests    puppetdb.conf  routes.yaml
auth.conf.dpkg-dist  config.ru      hiera.yaml    puppet.conf  r10k           unicorn.conf

$ ls /etc/puppet/environments/production
dist  manifests  modules  Puppetfile  README.md

dist contain modules in ~/puppet, modules contain modules specified by Puppetfile
Now the problem is that puppet always applies modules in /etc/puppet/environments/production/dist, even the environment is not.
In data01
$ sudo puppet agent --environment datanode -t

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: Evaluation Error: Error while evaluating a Function Call, Could not find class package::data for data01 at /etc/puppet/environments/datanode/manifests/data.pp:9:3 on node data01

But it is there.

$cat /etc/puppet/environments/datanode/dist/package/manifests/data.pp

class package::data {

...

}

when I run puppet master in debug mode , I find it applies all modules in /etc/puppet/environments/production/dist, like following:

Debug: importing '/etc/puppet/environments/production/dist/supervisor/manifests/params.pp' in environment datanode

Debug: Automatically imported supervisor::params from supervisor/params into datanode

Debug: importing '/etc/puppet/environments/production/dist/nrpe/manifests/checker/supervisor.pp' in environment datanode

Debug: Automatically imported nrpe::checker::supervisor from nrpe/checker/supervisor into datanode

Debug: importing '/etc/puppet/environments/production/dist/nrpe/manifests/checker/cfb.pp' in environment datanode


So I am completely confused.



Reply all
Reply to author
Forward
0 new messages