serwei2014@gmail.com
2013-Feb-22 06:39 UTC
[Puppet Users] how to co-exist ENC and standard node definitions in site.pp?
In the puppet document has such a word: ENCs can co-exist with standard node definitions in site.pp, and the classes declared in each source are effectively merged. but in my test environment,if not work: for example(puppet version 2.6.11) now enable ENC [root@puppetmaster-tools puppet]# cat /etc/puppet/puppet.conf|tail -3 external_nodes = /etc/puppet/puppet_node_classifier modulepath = /etc/puppet/modules site.conf : node /test.test.cn/ { include tools } #node /local-web-cdn-70-200.idc.test.cn/ { # class { "tools::test": version => "test" } # include tools::test # include test #} The result : node test.test.cn work ok,but node local-web-cdn-70-200.idc.test.cn has some error like this: -bash-3.2# puppetd --test err: Could not retrieve catalog from remote server: Error 400 on SERVER: Could not find default node or by name with ''local-web-cdn-70-200.idc.test.cn, local-web-cdn-70-200.idc.test, local-web-cdn-70-200.idc, local-web-cdn-70-200'' on node local-web-cdn-70-200.idc.test.cn warning: Not using cache on failed catalog err: Could not retrieve catalog; skipping run if edit site.pp, for examlpe: site.conf : #node /test.test.cn/ { # include tools #} #node /local-web-cdn-70-200.idc.test.cn/ { # class { "tools::test": version => "test" } # include tools::test # include test #} two node work ok,all used ENC how to co-exist ENC and standard node definitions in site.pp? -- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
Nick Fagerlund
2013-Feb-22 07:39 UTC
[Puppet Users] Re: how to co-exist ENC and standard node definitions in site.pp?
You are almost doing it right. But: "If site.pp contains at least one node definition, it must have one for * every* node; compilation for a node will fail if one cannot be found." From http://docs.puppetlabs.com/puppet/3/reference/lang_node_definitions.html#behavior So if you have ANY node statements in site.pp, you must have one to match EVERY node. The easy way to do this is to add "node default." Node default may be empty, but it must exist: node default { # Nothing special; use only info from ENC. } (If there are NO node statements in site.pp, you don''t need node default. That is why it works fine when you comment out everything.) On Thursday, February 21, 2013 10:39:52 PM UTC-8, serwe...@gmail.com wrote:> > In the puppet document has such a word: > ENCs can co-exist with standard node definitions in site.pp, > and the classes declared in each source are effectively merged. > > but in my test environment,if not work: > > for example(puppet version 2.6.11) > > now enable ENC > [root@puppetmaster-tools puppet]# cat /etc/puppet/puppet.conf|tail -3 > external_nodes = /etc/puppet/puppet_node_classifier > modulepath = /etc/puppet/modules > > > site.conf : > node /test.test.cn/ { > include tools > } > #node /local-web-cdn-70-200.idc.test.cn/ { > # class { "tools::test": version => "test" } > # include tools::test > # include test > #} > > The result : > node test.test.cn work ok,but node local-web-cdn-70-200.idc.test.cn has > some error like this: > -bash-3.2# puppetd --test > err: Could not retrieve catalog from remote server: Error 400 on SERVER: > Could not find default node or by name with > ''local-web-cdn-70-200.idc.test.cn, local-web-cdn-70-200.idc.test, > local-web-cdn-70-200.idc, local-web-cdn-70-200'' on > node local-web-cdn-70-200.idc.test.cn > warning: Not using cache on failed catalog > err: Could not retrieve catalog; skipping run > > if edit site.pp, for examlpe: > site.conf : > #node /test.test.cn/ { > # include tools > #} > #node /local-web-cdn-70-200.idc.test.cn/ { > # class { "tools::test": version => "test" } > # include tools::test > # include test > #} > two node work ok,all used ENC > > how to co-exist ENC and standard node definitions in site.pp? >-- 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+unsubscribe@googlegroups.com. To post to this group, send email to puppet-users@googlegroups.com. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.