Hi. I'm trying to accomplish something like this:
node "node1" {
$foo_var1 = true
include foo
}
node "node2" {
$foo_var1 = true
$foo_var2 = true
include foo
}
class foo {
file { "/etc/foo.conf":
content => template("foo.conf.erb"),
}
}
And the foo.conf.erb looks like:
<% defined? foo_var1 %>
... stuff to be included for nodes where foo_ is defined ...
<% end %>
<% defined? foo_var2 %>
... stuff to be included for nodes where foo_ is defined ...
<% end %>
I admit my puppet and ruby skills are poor, but I expected to
get something like this for node1:
... stuff to be included for nodes where foo_ is defined ...
And for node2:
... stuff to be included for nodes where foo_ is defined ...
... stuff to be included for nodes where foo_ is defined ...
I've tried many variations on the template, but in all cases
the rendered file is empty.
How can I accomplish this? Include sections in the template
based on the definededness of variables.
Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/puppet-users?hl=en
-~----------~----~----~----~------~----~------~--~---