Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
* Thu Oct 19 2023 David Gardner <github.com@icmfp.com> - 1.1.4-0
- Add support for emptying group when no members are specified (#20)

* Sun Oct 03 2021 Iain Hallam <iain@nineworlds.net> - 1.1.3-0
- Add support for Debian

Expand Down
23 changes: 10 additions & 13 deletions lib/puppet/provider/group/gpasswd.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,9 @@ def members_insync?(is, should)
Puppet::Etc.send('getpwnam', user)
end

Puppet.debug("Ignoring unknown user: '#{user}'")

false
rescue
Puppet.debug("Ignoring unknown user: '#{user}'")

true
end
Expand All @@ -129,19 +128,17 @@ def members=(to_set)
to_be_added = to_set.dup
end

unless to_be_added.empty?
if @resource[:auth_membership]
cmd << [ command(:modmember),'-M',to_be_added.join(','), @resource[:name] ].shelljoin
else
to_be_added = to_be_added | @current_members

!to_be_added.empty? && cmd += to_be_added.map { |x|
[ command(:addmember),'-a',x,@resource[:name] ].shelljoin
}
end
if @resource[:auth_membership]
cmd << [ command(:modmember),'-M',to_be_added.join(','), @resource[:name] ].shelljoin
else
to_be_added = to_be_added | @current_members

mod_group(cmd)
!to_be_added.empty? && cmd += to_be_added.map { |x|
[ command(:addmember),'-a',x,@resource[:name] ].shelljoin
}
end

mod_group(cmd)
end

private
Expand Down
2 changes: 1 addition & 1 deletion metadata.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "onyxpoint-gpasswd",
"version": "1.1.3",
"version": "1.1.4",
"author": "Trevor Vaughan <tvaughan@onyxpoint.com>",
"summary": "Adds support for :manages_members to the Linux group native type",
"license": "Apache-2.0",
Expand Down