On 2013-14-11 12:32, Patricia Jung wrote:
Dear puppet wizards,

http://docs.puppetlabs.com/puppet/3/reference/lang_defined_types.html does not 
suggest to me that nested parametrized defines would be forbidden, hence I 
expected the following code to work:

add_to_ssh_authorized_keys.pp:
--------
define a::ssh_keys::add_to_ssh_authorized_keys($homebasedir="/home", $targetuser="root", 
$keyowner, $keyownername, $state="present" ) {
  $sshdir = "$homebasedir/$targetuser/.ssh"
  $authfile = "$sshdir/authorized_keys"

  ssh_authorized_key {"[email protected]($keyownername 4096) as 
$targetuser":
    key     => template("ssh_public_keys/$keyowner"),
    ensure  => "$state",
    name    => "$keyownername",
    type    => 'ssh-rsa',
    target  => $authfile,
    user    => $targetuser,
} }
---------

it_services_admins.pp:
---------
define a::ssh_keys::it_services_admins($user='root'){

     censhare::ssh_keys::add_to_ssh_authorized_keys{ "$user-blah":
         targetuser => "$user",
         keyowner => 'blah',
         keyownername => 'blah',
     }
}

---------

class file:
------------
class ….{
        censhare::ssh_keys::it_services_admins{ 'b':
                user => 'b'
            }
            censhare::ssh_keys::it_services_admins { 'root':
                user => 'root'
            }
}

Looks like you are missing a:: before censhare::ssh_keys...

- henrik


--
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/l63n0g%246tf%241%40ger.gmane.org.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to