> Hello Andrew, > > I'm getting a syntax error when trying to use the ssh::auth module ("Syntax > error at '{'; expected '}' at .../auth.pp:111"). It looks like it's > something > to do with parameters after a collection, i.e. line 111 is: > > if $ensure { Ssh_auth_key_client <| title == $title |> { ensure => $ensure } } > > I've had a quick look in puppet documentation and can't find reference (e.g. > in > language tutorial, etc.) to that syntax. I also searched the mailing lists > and found something in unrelated discussion on dev list from which I gathered > that it is a valid syntax. Is it something new (i.e. newer than 0.24.8)? > > Should ssh::auth work on 0.24.8?
Hi Michael. The reference for this syntax is at http://reductivelabs.com/trac/puppet/wiki/VirtualResources (linked from http://reductivelabs.com/trac/puppet/wiki/LanguageTutorial#virtual-resources). The docs say that virtual resources are supported since 0.20.0, but they don't say whether the "collection" syntax ( <|...|> ) is supported since then-- maybe it's more recent. I'm running 0.25.4, so it's possible that you need a more recent version of Puppet than 0.24.8 to use ssh::auth. If someone can clarify what Puppet version is required for the collection syntax, I'll add it to the list of requirements of ssh::auth. > BTW, I gather the above should be equivalent to: > > if $ensure { Ssh_auth_key_client[$title] { ensure => $ensure } } > > yes? No, that's not correct. To realize a virtual resource, you have to use either the collection syntax, as in ssh::auth; or the realize function: realize Ssh_auth_key_client[$title] which, according to the docs, doesn't seem to support adding parameters, e.g. realize Ssh_auth_key_client[$title]{ ensure => $ensure } However, in my testing I found that the above does in fact work, but only if the parameters inside the brackets haven't been set yet. That makes it not useful for ssh::auth, where the purpose is to override defaults. It's also undocumented. If the collection syntax makes ssh::auth unusable in Puppet 0.24, I'd gladly change it to something more compatible. But because of the limitation of the realize function, I can't see a way to do that right now. Andrew. -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-us...@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.