On Tuesday, December 29, 2015 at 4:00:26 PM UTC-6, Thorsten wrote: > > > I created a set of configurations for some nodes in my > /etc/puppet/manifests/site.pp, as follows: > > node 'client1', 'client2', 'client3', 'client4', 'client5' { > include preconfig > include selinux > import 'timezone.pp' > include ntp > include oracle_java > import 'nagiosplugins.pp' > import 'nrpe.pp' > import 'cassandra.pp' > include httpd > } > > (The imported files are stored in same directory as site.pp) > So far everything works perfectly, all clients will receive the software > and configuration as defined. >
If it works as you intended, then your manifest set is very strange indeed. Your placement of 'import' statements inside a node block strongly suggests that you have a mistaken idea of what they do. Their effect is not scoped to the node block -- rather, the scope of any declarations within the imported files is whatever scope is implied by the file itself. That the effect is what you expected for the original node block indicates that you have top-scope class or resource declarations in those files, and by importing them into 'site.pp', you get top-scope declarations in 'site.pp '. > > Now I added a client6 to my site.pp as follows: > > node 'client6' { > include selinux > import 'timezone.pp' > include ntp > include oracle_java > import 'nagiosplugins.pp' > import 'nrpe.pp' > } > > This causes my puppet client on client6 to act really strange. It looks > like puppet will ignore the node settings and try to run all configurations > on client6, even the ones, not specified in the node 'client6' section. > Yes and no. You imported top-scope class and / or resource declarations into your site manifest (even though the 'import' statements appear inside a node block). These apply to all nodes. The 'import' statement was deprecated somewhere in the Puppet 3 series, and it has been removed from Puppet 4. If you want to split your site manifest across multiple files, which is about the only good use that remained for ' import' in Puppet 3, then you can do that more easily in Puppet 4 simply by using a site manifest directory. But that does not appear to be what you are actually trying to do. Instead of putting all your manifests in the site manifest directory, create proper modules for them. Instead of top-scope class and resource declarations in your manifests, put all your class and resource declarations inside class bodies (of classes in modules) or node blocks. John -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/745b8215-417c-41b1-aeab-1a78f2c7666e%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.