Ask Your Question

Revision history [back]

A couple of issues here.


create_resources('ssh_authorized_key',hiera('ssh_keys'),{ user => $title })

will result in each ssh_authorized_key having the user set to the name of the class (possibly node def) of what calls it.

If you want to use this sort of syntax, you will need to use a wrapper defined type, such as:

define module::my_ssh_auth_keys(
  $ensure  = present,
  $type    = 'ssh-dss',
  $user    = $name,
  $options = []
      ensure  => $ensure,
      name    => $name,
      type    => $type,
      user    => $user,
      options => $options,

Then in your node def, or a role or profile class, you can do like:


I generally recommend the use of $name over $title because you get a more consistent behavior between classes and defines. There are some edge cases where $title will not do what would be expected.