camptocamp / puppet-selinux

http://www.camptocamp.com
1 stars 8 forks source link

ensure => absent not working for fcontext #41

Open ubellavance opened 7 years ago

ubellavance commented 7 years ago

It looks like some code is there to try to implement the deletion of an fcontext (ensure => absent), but I think it's not complete:

  if $ensure == 'present' {
    $semanage = '--add'
    $grep     = 'egrep'
  } else {
      $semanage = '--delete'
      $grep     = '! egrep -q'
  }

https://github.com/camptocamp/puppet-selinux/blob/master/manifests/fcontext.pp#L45-L51

However, since $semanage is not used anywhere in the exec block, it will add the fcontext even if you use ensure => absent. I'll try to submit a PR soon.

raphink commented 6 years ago

tbh, this should be recoded as a type and provider to be cleaner.

It does look like it was half implemented indeed.