Thanks for the reply,

It probably doesn't need to be virtual but I thought I read in the
documentation that it was better to do so.

Basically, at my organization, admins come and go. I was hoping to use
puppet to get rid of all logins of admins that no longer work for the
company. So, I was hoping I could just use a simple array to add users
as time goes by to ensure those user no longer have an account.

On Dec 7, 1:07 pm, jcbollinger <[email protected]> wrote:
> On Dec 6, 1:55 pm, jokeeffe <[email protected]> wrote:
>
>
>
>
>
> > I'm trying to do something like this using puppet 0.24.8.
>
> > define removeuser() {
> >   @ user { $name:
> >       ensure => absent
> >   }
>
> >   realize User["$name"]
>
> > }
>
> > $removelist = ["bob", "bill", "billy"]
> > @ removeuser { $removelist : }
>
> > It's failing with "err: Could not retrieve catalog: Failed to realize
> > virtual resources User[bob] on node test". Is this even possible, if
> > not in version .24 or .25, in future versions?
>
> In Puppet 0.24.8, I am able to remove a system user by realizing a
> virtual User resource that has ensure=>absent.  Admittedly, I am using
> a custom user provider, but it ought to work with any of the built-in
> providers that support user removal (which I think is all of them).
>
> I confess to a bit of confusion about your approach, however: why are
> you declaring virtual users and then immediately realizing them?  I'm
> not seeing any reason why it would make sense to do that.
>
> I would be surprised if the immediate realization were the problem,
> but for test purposes, at least, you should be able to declare the
> affected users concretely (with ensure => absent):
>
> define removeuser() {
>   user { $name:
>       ensure => absent,
>   }
>
> }
>
> If that doesn't solve the problem (as I suspect it won't) then you
> will at least have removed a variable.  Have you tried running with --
> debug and / or --test?

--

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


Reply via email to