[Puppet Users] Puppet3: top scope rooted variable, don't get it

Julien Deloubes
Mon, 17 Mar 2014 21:21:00 -0000

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.

--
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 puppet-users+unsubscribe@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/puppet-users/2ca6e8af-3f8e-4f7e-a625-158d93c5f292%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.