Ask Your Question

Is it possible to deny puppet master applying manifests in /etc/puppet/manifests to all hosts

asked 2015-12-30 17:59:24 -0600

Thorsten gravatar image

Dear community,

I'm new to puppet and already spent lots of time trying to create an easy structure to trace my config. So I decided to specify my nodes in site.pp and for each module I want to be installed on the specific node, I created a seperate pp-file, which then is imported in site.pp. Example:



node 'client1, 'client2', 'client3' { import 'timezone.pp' import 'selinux.pp' import 'apache.pp' }

node 'client4', 'client5' { import 'timezone.pp' import 'selinux.pp' import 'apache.pp' import 'mysql.pp' import 'nrpe.pp' }


During my tests, I realized that this is not going to work properly, as all my seperate manifests will be applied to any of my nodes. The site.pp definitions are ignored.

Now my question is if my clean and seperated manifests way is just silly or if there is a way of preventing puppet from compiling all manifests in /etc/puppet/manifests and just use the definitions in the site.pp file.

I also checked "puppet config print manifest" which tells explicitly "/etc/puppet/manifests/site.pp". That made me think my approach should be right, but I'm stuck now.

The idea behind the imported manifests is that my colleagues will have a better chance to see which things are definde for which node, at a glance, without having to read through a whole script of definitions.

Thank you very much in advance


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2016-01-01 00:03:58 -0600

You're off on the wrong track here.

Firstly, be aware that 'import' has been deprecated for quite a while, and removed altogether in Puppet 4.

Secondly, you need to look into the roles and profiles pattern for the correct way of structuring all this code.

(Unless it's a very small site, and expected to always be small, then roles & profiles might be overkill for you.)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2015-12-30 17:59:24 -0600

Seen: 186 times

Last updated: Jan 01 '16