That's been a great help.

I have been able to use the config you presented to create user's defined 
in Hiera. I am just trying to expand upon that.

Currently I do a:

---
users:
  jane.doe


The value 'jane.doe' is obviously passed to the $title variable. Is it 
possible to pass a second variable into the same loop in order to set 
something else unique to each user?

Additionally can this be adapted to remove users from certain servers via 
Hiera at all? You mention 'Resources meta-resource' but I cannot see the 
connection if any.

On Wednesday, 21 May 2014 21:25:00 UTC+1, jcbollinger wrote:
>
>
>
> On Wednesday, May 21, 2014 1:58:22 PM UTC-5, Danny Roberts wrote:
>>
>> 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
>>
>>
> As Doug acknowledged, that requires turning on the future parser, which PL 
> does not recommend for production systems.  But no sweat, you can do this 
> with the conventional parser almost as easily.  You need to grease the 
> wheels with a defined type:
>
> define company::user ($ensure = 'present') {
>   user { $title:
>     ensure  => $ensure,
>     gid     => "company",
>     home    => "/home/${title}",
>     managehome => true,
>     shell => "/bin/bash",
>     require => Group["company"]
>   }
> }
>
> Then you can do this:
>
> class company::sshkeys ( users, ) {
>   company::user { $users: }
> }
>
>
> That's as far as your example suggested you wanted to go, but do note that 
> it does nothing to remove previously configured users that you no longer 
> want.  If that's a concern to you then you could consider purging unmanaged 
> users via a Resources meta-resource.
>
>
> John
>
>

-- 
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/541ef591-0508-4dca-98e0-c3f07f924b08%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to