On Dec 6, 1:55 pm, jokeeffe <jete.okee...@gmail.com> 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 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