Starting in Pupet 3.2, there is experimental support for iteration:

http://docs.puppetlabs.com/puppet/3/reference/lang_experimental_3_2.html#collection-manipulation-and-iteration


On Jun 10, 2013, at 3:41 PM, Martin Langhoff <[email protected]> wrote:

> Sysadmins have the (reasonable?) expectation of installing more than
> one ssh key.
> 
> Relevant bits from my current config follows:
> 
> class rl_users {
>        define ssh_user($uid, $gid, $password, $akey, $ensure=present) {
>                user{ $name :
>                        ensure   => $ensure, managehome => true,
>                        uid      => $uid,    gid        => $gid,
>                        password => $password,
>                        groups   => ['wheel'],
>                        require  => Group[$name],
>                }
>                group { $name :
>                        ensure => $ensure,
>                        gid    => $gid,
>                }
>                ssh_authorized_key { "${name}-akey":
>                        ensure  => $ensure,
>                        key     => $akey,
>                        type    => 'ssh-rsa',
>                        user    => $name,
>                        require => User[$name],
>                }
> }
> 
> @ssh_user { 'foo':
>                uid=> 2004 , gid => 2004,
>                password => '$6$foo',
>                akey => 'AAAAB3xyz/VFwxhtYhw==',
>        }
> 
> # how can we support user bar?
> @ssh_user { 'bar':
>                uid=> 2005 , gid => 2005,
>                password => '$6$bar',
>                akey => [ 'AAAAB3xyz/VFwxhtYhw==',
>                               ''AAAABzzzzz==' ]
>        }
> 
> Right now I have a fugly kludge in place to support a second "akey0" slot.
> 
> 
> 
> m
> --
> [email protected]
> -  ask interesting questions
> - don't get distracted with shiny stuff  - working code first
> ~ http://docs.moodle.org/en/User:Martin_Langhoff
> 
> -- 
> 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 post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/puppet-users?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
> 
> 

-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to