Skip to content

Conversation

@ekohl
Copy link
Collaborator

@ekohl ekohl commented Sep 22, 2022

This attempts to unify SELinux handling in the tests. It moves the package installation to the acceptance spec helper to reduce duplication. It then makes the set_apache_defaults line idempotent and restorecon_apache correctly chained. This works around PUP-10548 which is that Puppet doesn't reload file contexts within a run. That means it must first create the file(s) and then run restorecon to get correct contexts.

@ekohl ekohl requested a review from a team as a code owner September 22, 2022 09:46
@github-actions
Copy link

Hello! 👋

This pull request has been open for a while and has had no recent activity. We've labelled it with attention-needed so that we can get a clear view of which PRs need our attention.

If you are waiting on a response from us we will try and address your comments on a future Community Day.

Alternatively, if it is no longer relevant to you please close the PR with a comment.

Please note that if a pull request receives no update for 7 after it has been labelled, it will be closed. We are always happy to re-open pull request if they have been closed in error.

@ekohl ekohl force-pushed the clean-up-selinux-in-acceptance branch from 86baa59 to 4d3e56e Compare November 23, 2022 12:13
@github-actions github-actions bot closed this Dec 1, 2022
@ekohl ekohl reopened this Dec 1, 2022
@ekohl ekohl force-pushed the clean-up-selinux-in-acceptance branch from 4d3e56e to 751b8c7 Compare December 1, 2022 11:46
bastelfreak
bastelfreak previously approved these changes Dec 1, 2022
This attempts to unify SELinux handling in the tests. It moves the
package installation to the acceptance spec helper to reduce
duplication. It then makes the set_apache_defaults line idempotent and
restorecon_apache correctly chained. This works around [PUP-10548] which
is that Puppet doesn't reload file contexts within a run. That means it
must first create the file(s) and then run restorecon to get correct
contexts.

[PUP-10548]: https://tickets.puppetlabs.com/browse/PUP-10548
@ekohl
Copy link
Collaborator Author

ekohl commented Dec 2, 2022

I think this is now ready to merge. Still not ready to enforce SELinux, but at least it makes it work idempotently in permissive mode. That's a step forward.

Copy link
Contributor

@chelnak chelnak left a comment

Choose a reason for hiding this comment

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

Looks nice and clean to
Me.. however I'd like to leave it to @david22swan for the final approval and merge.

Copy link
Member

@david22swan david22swan left a comment

Choose a reason for hiding this comment

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

LGTM

@david22swan david22swan merged commit 9aabe24 into puppetlabs:main Dec 5, 2022
@ekohl ekohl deleted the clean-up-selinux-in-acceptance branch December 5, 2022 11:27
path => '/bin:/usr/bin/:/sbin:/usr/sbin',
require => Package[$semanage_package],
}
exec { 'restorecon_apache':
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Btw, the explicit restorecon is needed because of https://tickets.puppetlabs.com/browse/PUP-10548. Otherwise the file type would take care of it.

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.

5 participants