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

install icinga2-selinux #602

Merged
merged 9 commits into from
Feb 20, 2020
Merged

install icinga2-selinux #602

merged 9 commits into from
Feb 20, 2020

Conversation

b3n4kh
Copy link
Contributor

@b3n4kh b3n4kh commented Jan 11, 2020

Fixe issue #592

exec { '/usr/sbin/restorecon -R -F /var/lib/icinga2':
refreshonly => true
}
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two things I have in mind here:

  • Limit this to osfamily - redhat
  • Why the manual restorecon exec?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Limit to RedHat family isn't needed. SELinux is included since kernel 2.6 and not limited to RedHat systems. But of course the icinga project only distributes packages for RedHat family. Maybe this will change in the future.

We switched to module data in puppet-icinga2 v2.0 so you're able to use your own configured package. In this case it's important that the default fit to the operating system or is set to false.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since there is no package icinga2-selinux on distributions other than RHEL, I'd opt for the osfamily as otherwise the manifest will fail on Debian and alike. Even if you manage all that with a boolean up front.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Default to false to all platforms (include Debian), the puppet run will be finished without any errors. If you set selinux to true you have to know what you're doing.

Starts with module data it isn't accepted to set such limits anymore. Because now you can extend the module with your own packages or packages for not supported platform.

@lbetz lbetz added this to the 2.4.0 milestone Jan 13, 2020
@lbetz
Copy link
Contributor

lbetz commented Jan 27, 2020

Please explain the requirement of:

exec { '/usr/sbin/restorecon -R -F /var/lib/icinga2':
refreshonly => true
}

@b3n4kh
Copy link
Contributor Author

b3n4kh commented Jan 27, 2020

Sorry for not answering sooner. I originally had problems getting it to work without that exec and didn't find the time to debug where it came from. I now know that the problem actually came from using a workaround similar to the one discribed here but unfornunalty I installed icinga2-selinux before installaing icinga2, which resulted in the postinstall script of icinga2-seliunx getting triggerd at a point in time some files are still missing. This postinstall actually does a fixfiles and therefore makes this exec obsolete. Maybe there should be an Require from the icinga2-selinux rpm to the icinga2 rpm (it right now only requires the icinga2-bin)?

I also added a hiera data to only install on rhel and only when selinux is actually enabled.

@lbetz lbetz self-assigned this Feb 20, 2020
@lbetz lbetz merged commit d96f713 into voxpupuli:master Feb 20, 2020
lbetz added a commit that referenced this pull request Feb 21, 2020
@lbetz lbetz modified the milestones: 2.4.0, 2.5.0 Mar 24, 2020
@lbetz lbetz added wontfix and removed enhancement labels Mar 25, 2020
@lbetz lbetz added enhancement and removed wontfix labels Apr 24, 2020
lbetz added a commit that referenced this pull request Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants