Can someone explain to me why would this work :
node 'puppetagent'{
$my_role="proxmoxnode"
include role_proxmoxnode
}
class role_proxmoxnode {
include sshdconf
}
And this won’t :
node 'puppetagent'{
include role_proxmoxnode
}
class role_proxmoxnode {
$my_role="proxmoxnode"
include sshdconf
}
By “Work” I mean that the sshd_config.erb file set by sshdconf module will find the $my_role=”proxmoxnode” as expected. By “won’t work”, I mean the template complaining with “Could not find value for ‘my_role'”
I use puppet 3.0.
I followed the doc in http://projects.puppetlabs.com/projects/1/wiki/Infrastructure_Design_Guidelines about roles.
Thanks
In Puppet 3.0. unqualified variables are looked up in 4 places:
Local scope, by the way, would apply to variables defined in the class, not in classes which simply include it.
So, in your first example, we go looking:
In the second example…
Clear?