Skip to content

Commit

Permalink
selinux_login: Add sync to provider and type
Browse files Browse the repository at this point in the history
This allows for the login configuration to be updated, and not just
created and removed.
  • Loading branch information
EmRowlands committed Jul 13, 2023
1 parent 340c17e commit a99009c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/puppet/provider/selinux_login/semanage.rb
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ def create
semanage(*args)
end

def sync
args = ['login', '-m', '-s', @resource[:selinux_user], @resource[:selinux_login_name]]
semanage(*args)
end

def destroy
args = ['login', '-d', @property_hash[:selinux_login_name]]
semanage(*args)
Expand Down
6 changes: 6 additions & 0 deletions lib/puppet/type/selinux_login.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
newproperty(:selinux_user) do
desc 'The selinux user to map to.'
isrequired

def sync
event = super
provider.sync
event
end
end

newproperty(:source) do
Expand Down

0 comments on commit a99009c

Please sign in to comment.