How can I add multiple members to a group by chef?
I tried like this, but it fails.
group "git" do
action :modify
members "foo, bar"
append true
end
I can do like this, but members
seems to accept multiple users. How can I use it?
%w(foo bar).each do |m|
group "git" do
action :modify
members m
append true
end
end
Most arguments that accept multiple inputs in Chef work with standard ruby array syntax. I can't find an example just now, and it's very frustrating that the group
docs don't provide an example of multiple users. In fact, they just say
members
Indicates which users should be set or appended to a group.
And only provide examples with single users. That said, members ["foo", "bar"]
should be the way to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With