On 1/30/15 4:53 PM, Sans wrote:
> This is the class I have for the user creation:
> 
>     /*#users.pp
>     */
> 
>     class common::users {
> 
>         create_resources('group', hiera_hash('groups'))
>        
>         define create_ssh_users () {
>             user { $name:
>                 password   => $password,
>                 managehome => $managehome,
>                 groups     => $groups,
>                 ensure     => $ensure,
>             } ->
> 
>             ssh_authorized_key { $name:
>                 user       => $name,
>                 type       => $type,
>                 key        => $key,
>                 ensure     => $ensure,
>                 purge_ssh_keys => $purge_ssh_keys,
>             }
>         }
>         create_resources('create_ssh_users', hiera_hash('ssh_users'))
>     }
> 
> 
> in my */nodes.pp/*: 
> 
>     hiera_include('classes')
> 
> 
> 
> and the associated hiera file is like this:
> 
>     /*#users.yaml*/
> 
>     classes:
>         - 'common::users'
> 
>     groups:
>         'admins':
>             ensure: present
>             gid: '2001'
>         'network':
>             ensure: present
>             gid: '2002'
> 
>     ssh_users:
>         'sans':
>             password: '$1$33mRSE$deEDRKq2aGPu0'
>             managehome: true
>             key: 'AAAAB3NzaC1yc2EAAA....zdqs8etdh'
>             purge_ssh_keys: true
>             groups:
>                 - 'admins'
>                 - 'networks'
> 
>             ensure: present
> 
>         'joe':
>             ....
>             ....
> 
> 
> 
> When I run puppet, I see errors like:
> 
> Error: Invalid parameter managehome on
> Common::Users::Create_ssh_users[andy] on node p19-d-nagios-001
> or
> Error: Invalid parameter purge_ssh_keys on
> Common::Users::Create_ssh_users[sans] on node p19-d-nagios-001
> 
> 
> The errors are pretty inconsistent - changes the parameter (i.e.
> sometimes it's managehome, next time is key etc.) and the user-name over
> time. Can anyone tell what am I missing please?
> Best!
> 

Hi,

I have a module with all of this functionality and tests :)

https://github.com/ghoneycutt/puppet-module-common#usage

Best regards,
-g


-- 
Garrett Honeycutt
@learnpuppet
Puppet Training with LearnPuppet.com
Mobile: +1.206.414.8658

-- 
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 puppet-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/54D8EC16.6040009%40garretthoneycutt.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to