On 11/04/2010 10:40 AM, Martin Alfke wrote:
> 
> On Nov 4, 2010, at 8:28 AM, hywl51 wrote:
> 
>> Hi, all
>>
>> I want to control the user accounts on our company servers with
>> puppet. The complete requirements are the following:
>>
>> 1. Assuming that one user run " useradd ...." on the server to create
>> a new account named "newuser".
>> 2. Puppet will konw the new user created soon, and restore the server
>> status to the before. That is, puppet will delete the new user.
>>
>>
>> I am not sure if puppet could fullfill this requirement. Could anyone
>> give me some advices.
>>
>> Thanks
>> hywl51
> 
> 
> Hi,
> 
> I would assume that you can define a resource default:
> 
> User { ensure => absent }
> 
> and afterwards define the users you would like to be present on your system.

Not at all. This default will apply to all users that you define in your
manifest. So this

user { [ "www-data","cron" ]: }

will indeed ensure those user's absence, but puppet has no concept of
"remove resources I have not declared anywhere".

So unless you prune /etc/passwd, /home etc., this will do you not as
much good as you hope.

Someone brought up the issue that puppet would erase and recreate all
users during every run. That isn't how puppet works either. This

User { ensure => absent }
user { "www-data": ensure => present }

will make puppet do nothing if the user exists already. Which is good,
but of no help to the OP's problem.

Cheers,
Felix

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-us...@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to