tu2Bgone@gmail.com
2010-Nov-24 01:31 UTC
[Puppet Users] quick question on declaring variables in nodes with 2.6.2
Hi all, I run the test.pp on the master host and the notify supplies the correct variables in the class notify and define notify. node default { $puppet_master = "hitw-cn-master-1" include cn } node f13guest inherits default { include test test::thistest{"aname":} } notify{"outside class: $puppet_master":} class test { notify {"In class: $puppet_master":} define thistest { notify {"In define: $puppet_master":} } } #end class notice: In class: hitw-cn-master-1 notice: //test/Notify[In class: hitw-cn-master-1]/message: defined ''message'' as ''In class: hitw-cn-master-1'' notice: outside class: notice: //Notify[outside class: ]/message: defined ''message'' as ''outside class: '' notice: In define: hitw-cn-master-1 notice: //Node [f13gues]/Test::Thistest[aname]/Notify[In define: hitw-cn-master-1]/message: defined ''message'' as ''In define: hitw-cn-master-1'' When I use the same idea in the yumrepo class node ''hitw-gc-web01'' inherits gdn_default_web { include yum $puppet_master = "hitw-gc-master-1" } class yum { notify{"puppet master is: $puppet_master":} case $operatingsystem { redhat: { $yum_packagelist = [ "yum", "yum-utils", "yum-plugin-fastestmirror" ] } centos: { $yum_packagelist = [ "yum", "yum-utils", "yum-fastestmirror" ] } fedora: { $yum_packagelist = [ "yum", "yum-utils", "yum-plugin-fastestmirror" ] } } package { $yum_packagelist: ensure => installed } } yumrepo { "utils": baseurl => "http://$puppet_master/cblr/repo_mirror/utils", descr => "Puppet related utilities repo", enabled => 0, gpgcheck => 0, } } notice: /Stage[main]/Yum/Yumrepo[utils]/baseurl: is http://hitw-gc-master-2/cblr/repo_mirror/utils, should be http:///cblr/repo_mirror/utils (noop) notice: /Stage[main]/Yum/Notify[puppet master is: ]/message: is absent, should be puppet master is: (noop) Apart from the node declaration (declaring in the inherited node as opposed to the node itself) the concept is the same. What am I missing? Cheers, Den -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Daniel Pittman
2010-Nov-24 02:26 UTC
Re: [Puppet Users] quick question on declaring variables in nodes with 2.6.2
tu2Bgone@gmail.com writes: [...]> Apart from the node declaration (declaring in the inherited node as opposed > to the node itself) the concept is the same. > > What am I missing?Variables in the parent node are *not* visible in the child node when you use inheritance. Seems crazy, I know, but there you have it. Daniel -- ✣ Daniel Pittman ✉ daniel@rimspace.net ☎ +61 401 155 707 ♽ made with 100 percent post-consumer electrons -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Nigel Kersten
2010-Nov-24 02:55 UTC
Re: [Puppet Users] quick question on declaring variables in nodes with 2.6.2
On Tue, Nov 23, 2010 at 6:26 PM, Daniel Pittman <daniel@rimspace.net> wrote:> tu2Bgone@gmail.com writes: > > [...] > >> Apart from the node declaration (declaring in the inherited node as opposed >> to the node itself) the concept is the same. >> >> What am I missing? > > Variables in the parent node are *not* visible in the child node when you use > inheritance. Seems crazy, I know, but there you have it.http://projects.puppetlabs.com/projects/puppet/wiki/Frequently_Asked_Questions#Common%2BMisconceptions I''m generally not a fan of node inheritance. There are usually other approaches that are more easily built and debugged. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.