Fabien Bagard
2013-Jan-28 15:45 UTC
[Puppet Users] Puppet variable in site not accessible from class
Hi, I am having trouble trying to auto configure network on a client : Her are the important content : Site.pp : import "classes/client.pp" import "classes/server.pp" import "classes/service1.pp" import "classes/default-company.pp" ... node ''puppet-test-ubuntu.sub.domain.com'' inherits service1 { $dns1 = "172.20.10.73" $dns2 = "192.168.1.22" $dns3 = "172.20.10.14" $myip = "172.20.88.86" $mydomain = "domain.com" notify { "site" : message => "$myip - $mydomain - $dns1" } } classes/service1.pp node service1 inherits default-company { include module1 include network include module3 } module/network/manifest/init.pp: class network::install-common { } class network::install-Debian { } class network::install-RedHat { } class network::config-common { notify { "network" : message => "$myip - $mydomain - $dns1" } file { "/etc/network/interfaces" : ensure => present, owner => "root", group => "root", mode => "0644", # content => template(''/etc/puppet/modules/network/templates/interfaces'') } file { "/etc/resolv.conf" : ensure => present, owner => "root", group => "root", mode => "0644", content => template(''/etc/puppet/modules/network/templates/resolv.conf'') } } class network::config-Debian { } class network::config-RedHat { } class network::service { } class network { include network::install-common, "network::install-$osfamily", network::config-common, "network::config-$osfamily", network::service } When I run puppet agent -t on node puppet-test-ubuntu.sub.domain.com, I got this : notice: - sub.domain.com - notice: /Stage[main]/Network::Config-common/Notify[network]/message: defined ''message'' as '' - sub.domain.com - '' notice: 172.20.88.86 - domain.com - 172.20.10.73 notice: /Stage[main]//Node[puppet-test-ubuntu.unix.parrot.biz]/Notify[site]/message: defined ''message'' as ''172.20.88.86 - domain.com - 172.20.10.73'' How should I define the variable to get : notice: /Stage[main]/Network::Config-common/Notify[network]/message: defined ''message'' as ''172.20.88.86 - domain.com - 172.20.10.73'' ? Thank you -- 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. Visit this group at http://groups.google.com/group/puppet-users?hl=en. For more options, visit https://groups.google.com/groups/opt_out.