On Tuesday, September 24, 2013 1:21:29 AM UTC-5, ch huang wrote:
>
> i expect the file /tmp/conftest content will be "mymaster" not default
> "HM" on node bm ,but fail,anyone can help?
>
>
You cannot assign values to non-local variables. Even if you could, you
would not get your desired result because node inheritance does not work
the way you hope. The best solution is to feed data to your class from an
external source. Class parameters such as Rahul describes are a popular
vehicle for doing that, though you can also just load data directly via a
data-access function. Chief among such functions in modern Puppet is
hiera().
For small-scale testing purposes, however, you can also just bake the data
into your classes. Indeed, it looks like you are set up for that already.
For example, if you make this change
class hadoop::params {
$master = $::hostname ? {
'bm' => 'mymaster',
default => 'HM',
}
}
then you can remove node 'bm' altogether, and you will get the expected
result.
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users.
For more options, visit https://groups.google.com/groups/opt_out.