For some reason my Puppet install doesn't like that:

Error: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Syntax error at 'users'; expected ')' at 
/etc/puppet/modules/company/manifests/sshkeys.pp:1 on node puppetmaster
Warning: Not using cache on failed catalog
Error: Could not retrieve catalog; skipping run

On Wednesday, 21 May 2014 18:44:00 UTC+1, Doug_F wrote:
>
> Try getting your user list from hiera. Then it will easily be overridden 
> on a server basis. 
>
> class company::sshkeys ( users, ) {
>   
>   users.each |$my_user| {
>     user {  $my_user:
>       ensure  => present,
>       gid     => "company",
>       home    => "/home/${my_user}",
>       managehome => true,
>       shell => "/bin/bash",
>       require => Group["company"]
>     }
>   }
> }
>
>
>
> On Wed, May 21, 2014 at 11:21 AM, Danny Roberts <
> dannyrober...@googlemail.com <javascript:>> wrote:
>
>> I currently have a custom module that applies our companies' standard 
>> server config across all servers using Hiera. This includes a class called 
>> company::sshkeys that has various 'user' resource types (the standard 
>> puppet type) defined for all of our admins, for example:
>>
>> class company::sshkeys {
>>
>>   user {  "jane.doe":
>>                 ensure  => present,
>>                 gid     => "company",
>>                 home    => "/home/jane.doe",
>>                 managehome => true,
>>                 shell => "/bin/bash",
>>                 require => Group["company"]
>>         }
>>
>> }
>>
>> This is a slight simplification as the same class also includes our SSH 
>> public keys hence the name.
>>
>> I now find myself in the situation where I need to deny access to certain 
>> admins on a single server. We use Hiera in our set-up as much as possible 
>> and I would like to use Hiera to in the case of a single server tell Puppet 
>> to not create certain user accounts. I have tried many ways to do this but 
>> I am unsure on how to call the base resource types even though they are 
>> embedded in a custom class or even if such a thing is possible.
>>
>> Any thoughts on the cleanest way to exclude certain users from getting an 
>> account?
>>
>> -- 
>> 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...@googlegroups.com <javascript:>.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/puppet-users/5d0c1ae8-4c26-4135-b7b0-1146d97c9e53%40googlegroups.com<https://groups.google.com/d/msgid/puppet-users/5d0c1ae8-4c26-4135-b7b0-1146d97c9e53%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
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/2cd3f157-32d3-453e-9a5c-66a1c0ed5a86%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to