In puppet, modules can have a dash in their name, and thus variables can, too. But then, how can we use such variables?
For example, I have a $ssh_mode
variable defined in a google-authenticator::params
class, so I expect to be able to call $google-authenticator::params::ssh_mode
, but puppet (0.25.5) cuts on the dash. Using ${google-authenticator::params::ssh_mode}
doesn't help either.
What can I do to access this variable?
You could find this works in later versions. Certainly in Puppet 2.7, the variable interpolation in strings now includes dashes (which also causes a few compatibility issues).
The deeper problem though is you're relying on undefined handling of modules with dashes in. I'd strongly suggest you rename the module to use an underscore, or no separator. There are many bugs in Puppet (that come and go between different major versions) if you don't stick to this recommendation:
From Language Guide (Reserved Words & Acceptable Characters).
Here is a page describing the allowed characters in puppet identifiers.
Under class names section, you can read:
Under variables section, you can read: