Issue #2336 has been reported by Dick Davies.
----------------------------------------
Bug #2336: has_variable?("myclass:var") should return false, not error, if
myclass has not been evaluated
http://projects.reductivelabs.com/issues/2336
Author: Dick Davies
Status: Unreviewed
Priority: High
Assigned to:
Category:
Target version:
Complexity: Easy
Affected version: 0.24.8
Keywords:
I've templates that conditionally print sections of a file like this
<% if has_variable?("ssh:wants_firewall_rule") %>
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
<% end %>
then in the ssh class I just define
class ssh { $wants_firewall_rule = 1 #...... }
This works fine on nodes that 'include ssh' as planned.
On classes that don't, however, rather than has_variable?() evaluating to false,
puppetd dies with the error:
[r...@node03 ~]# puppetd -tv
info: Retrieving plugins
err: Could not retrieve catalog: Failed to parse template
iptables/iptables.erb: Class ssh has not been evaluated so its
variables cannot be referenced at
/etc/puppet/modules/iptables/manifests/init.pp:11 on node node03.pixie
warning: Not using cache on failed catalog
I don't feel it's an error for has_variable? to return false in this situation.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://reductivelabs.com/redmine/my/account
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" 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-bugs?hl=en
-~----------~----~----~----~------~----~------~--~---