- From: AJ Christensen <
>
- To: chef <
>
- Subject: [chef] Re: Re: Remove a user from a group?
- Date: Sat, 16 Mar 2013 12:19:39 +1300
The actions: manage does not create the group, modify does. You can
use combinations of create/remove manage/modify to allow a number of
group configurations.
You can use the ruby 'etc' std-lib module to query information about a
group at compile time (or converge via ruby_block. Shame we don't have
that delayed evaluation yet..)..
irb(main):001:0> require 'etc'
=> true
irb(main):002:0> wheel = Etc.getgrnam "wheel"
=> #<struct Struct::Group name="wheel", passwd="x", gid=10, mem=["root",
"aj"]>
irb(main):003:0> wheel.mem
=> ["root", "aj"]
Cheers, HTH!
AJ
On 16 March 2013 12:10, Peter Loron
<
>
wrote:
>
Hi, AJ. From my reading of the group docs (URL below), I'm only seeing the
>
ability to specify the complete set of users in a group, not the specific
>
user to remove. If true, in order to remove a user from a group, I would
>
need to know the list of all users in the group first, which I do not have.
>
I could probably gin up a way to get that list, but it seems very broken to
>
be able to add a specific user, but not remove oneā¦
>
>
Since I'm on the topic, is there any clarification between what the "manage"
>
and "modify" actions do?
>
>
http://docs.opscode.com/resource_group.html
>
>
-Pete
>
>
On Mar 15, 2013, at 3:41 PM, AJ Christensen
>
<
>
>
wrote:
>
>
You can :manage the entire group and remove a user from the 'members'
>
attribute.
>
>
Cheers,
>
>
AJ
>
>
On 16 March 2013 10:15, Peter Loron
>
<
>
>
wrote:
>
>
Hello. I'm working with the "group" provider, and I can see how to add a
>
user to a local group. However, I don't see a clean way to remove a user
>
from a group. My Google-fu has failed me. Can anybody shed some light on
>
this? Thanks.
>
>
-Pete
>
>
Archive powered by MHonArc 2.6.16.