Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow Groups to be managed or not #334

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
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
12 changes: 9 additions & 3 deletions files/providers/wls_group/modify.py.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ realm = '<%= realm %>'
authenticationprovider = '<%= authenticationprovider %>'
description = '<%= description %>'
users = '<%= users %>'.split(",")
manage_group = '<%= manage_group %>'

try:
cd('/')
Expand All @@ -28,9 +29,14 @@ try:
for user in users_to_add:
print 'Adding user: ' + user
atnr.addMemberToGroup(name,user)
for user in users_to_remove:
print 'Removing user: ' + user
atnr.removeMemberFromGroup(name,user)

if manage_group == 'true':
for user in users_to_remove:
print 'Removing user: ' + user
atnr.removeMemberFromGroup(name,user)
else:
print 'Skipping Removing Users'

report_back_success()

except:
Expand Down
1 change: 1 addition & 0 deletions lib/puppet/type/wls_group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module Puppet
parameter :name
parameter :group_name
parameter :timeout
parameter :manage_group
property :realm
property :authenticationprovider
property :users
Expand Down
14 changes: 14 additions & 0 deletions lib/puppet/type/wls_group/manage_group.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
newparam(:manage_group) do
include EasyType
include EasyType::Validators::Name

desc 'Modify Current Group Members'
defaultto 'true'

newvalues('true', 'false')

to_translate_to_resource do | raw_resource|
raw_resource['manage_group']
end

end