This may not fit your requirements but a slightly safer alternative might be set your old users' shells to /bin/false and null out their password, rather than delete them. A small added bonus is if your UIDs are never reused then all your UIDs will resolve to user accounts, which can be helpful later down the track if you want to know who owned which file, rather than it just be an unresolved UID number.

On 27/09/12 20:52, erkan yanar wrote:
Hoi  John,

On Thu, Sep 27, 2012 at 06:09:28AM -0700, jcbollinger wrote:

On Wednesday, September 26, 2012 2:15:27 PM UTC-5, erkules wrote:
On Wed, Sep 26, 2012 at 12:00:10PM -0700, Jo Rhett wrote:
Realizing doesn't allow overrides. To remove the user:

@user ahab { ensure => absent }
realize User['ahab']

This may mean you need to use inheritence for the class the user is
defined in, creating a child class for the nodes you want to remove him on.
Oha,
that sounds like putting a lot of thinking building the configuration
system.


Indeed, yes.  It is a complex task, and thinking is required.

Note, by the way, that virtualization really doesn't have much to do with
this particular issue.  There are basically two ways to remove users with
Puppet:

    1. The fairly safe way: manage the user, setting ensure => absent.  That
    'ensure' parameters could be set on the actual resource declaration,
    perhaps conditionally, or it could be overridden later, such as via a
    collection.
ok,

    2. The simple, but rather dangerous, way: use the 'resources'
    metaresource to declare that all unmanaged, non-system user accounts should
    be purged from the system.  This has the potential to bite you -- hard --
    but it has the advantage that all you have to do is stop realizing a user
    or else not declare him at all to have him removed.
I confess I like that idea.

Note that even approach (1) I designate only "fairly" safe.  It is that
because you explicitly specify all user removals, but nothing can change
the fact that removing users is inherently risky.

thx a lot
erkan



--
Luke Bigum
Senior Systems Engineer

Information Systems
Ph: +44 (0) 20 3192 2520
luke.bi...@lmax.com | http://www.lmax.com
LMAX, Yellow Building, 1A Nicholas Road, London W11 4AN


FX and CFDs are leveraged products that can result in losses exceeding
your deposit.  They are not suitable for everyone so please ensure you
fully understand the risks involved.  The information in this email is not
directed at residents of the United States of America or any other
jurisdiction where trading in CFDs and/or FX is restricted or prohibited
by local laws or regulations.

The information in this email and any attachment is confidential and is
intended only for the named recipient(s). The email may not be disclosed
or used by any person other than the addressee, nor may it be copied in
any way. If you are not the intended recipient please notify the sender
immediately and delete any copies of this message. Any unauthorised
copying, disclosure or distribution of the material in this e-mail is
strictly forbidden.

LMAX operates a multilateral trading facility. Authorised and regulated by the Financial Services Authority (firm registration number 509778) and is registered in England and Wales (number 06505809). Our registered address is Yellow Building, 1A Nicholas Road, London, W11
4AN.

--
You received this message because you are subscribed to the Google Groups "Puppet 
Users" group.
To post to this group, send email to puppet-users@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