Hello there,
i recently bought the new Pro Puppet 2nd edition.
There is something i don't understand, it's about the syntax of top scope rooted variable, here is an example (page 38 of the book):
class ssh_example::params{
case $::osfamily {
'Debian': { $sshd_package = 'ssh'}
'RedHat': { $sshd_package = 'openssh-server'}
default: {fail("Login class does not work on osfamily: ${::osfamily}")}
}
}
class ssh_example inherits ssh_example::params {
package { $::ssh_example::params::sshd_package:
ensure => installed,
}
}
As the book said: "The variable $::ssh_example::params::sshd_package is a way of writing the $sshd_package variable so that it can refer only to a single declaration"
I don't get it, OK there is a new package defined at top scope, but where is the relation between this new top scope package and the variable from the inherits class?
I don't understand the logic, could you help me?
Thanks.