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

Import resources from selinux_policy #79

Merged
merged 16 commits into from
Sep 2, 2021

Conversation

detjensrobert
Copy link
Contributor

@detjensrobert detjensrobert commented Aug 20, 2021

Description

Imports resources from the selinux_policy cookbook so we don't have duplicated cookbooks.

The new resources were redone to use native shell_out! instead of execute resources.

Also:

  • Adds spec tests for all resources
  • Converts tests to Inspec profiles
  • Library cleanup

Issues Resolved

(none)

Check List

  • All tests pass. See TESTING.md for details.
  • New functionality includes testing.
  • New functionality has been documented in the README if applicable.

⚠️ The kitchenConverge module fails to install on Debian/Ubuntu locally, but seems to be fine in GH CI 🤷


Cookbook migration

The merged resources have the same properties and are drop-in (with a rename), except the following:

  • the default :addormodify action has been renamed to :manage
  • the _module resource no longer accepts inline source, instead from a file on disk
  • _boolean now uses a property to set persistently instead of :setpersist action

@detjensrobert detjensrobert requested a review from a team August 20, 2021 21:34
@detjensrobert detjensrobert self-assigned this Aug 20, 2021
@detjensrobert detjensrobert added the Release: Minor Release to Chef Supermarket as a minor release when merged label Aug 20, 2021
@detjensrobert detjensrobert force-pushed the detjensrobert/selinux-policy-merger branch 2 times, most recently from 681fbe6 to 0a93e12 Compare August 20, 2021 22:16
documentation/selinux_fcontext.md Show resolved Hide resolved
documentation/selinux_fcontext.md Outdated Show resolved Hide resolved
documentation/selinux_port.md Outdated Show resolved Hide resolved
documentation/selinux_port.md Outdated Show resolved Hide resolved
documentation/selinux_permissive.md Show resolved Hide resolved
resources/port.rb Show resolved Hide resolved
resources/fcontext.rb Outdated Show resolved Hide resolved
resources/module.rb Outdated Show resolved Hide resolved
resources/module.rb Outdated Show resolved Hide resolved
resources/module.rb Outdated Show resolved Hide resolved
@detjensrobert detjensrobert force-pushed the detjensrobert/selinux-policy-merger branch 2 times, most recently from 1b1ad02 to 17f2db0 Compare August 24, 2021 21:20
@ramereth ramereth added Release: Major Release to Chef Supermarket as a major change when merged and removed Release: Minor Release to Chef Supermarket as a minor release when merged labels Aug 26, 2021
@detjensrobert detjensrobert force-pushed the detjensrobert/selinux-policy-merger branch from 0fc9b2b to 1deb9de Compare August 30, 2021 20:41
@ramereth
Copy link
Contributor

I really think it would be nice for users to add the resource names that were used in selinux_policy as a provides so that folks can more easily migrate to this cookbook. At least selinux_port seems like a good candidate as the properties do not change. What issues would we run into with the other resources we're copying over?

@detjensrobert
Copy link
Contributor Author

detjensrobert commented Aug 31, 2021

Aside from the deprecated :addormodify action, the properties on the migrated resources are the same. The main difference in the overlapping resources is with module and boolean. boolean's persistence was moved to a property toggle instead of an action, and module works somewhat differently internally but the main properties are the same.

Providing resource names from the other cookbook seems somewhat unnecessary, since the resource has changed and there are some other (minor) changes needed with the deprecations.

@ramereth ramereth requested a review from bmhughes September 2, 2021 18:53
@bmhughes bmhughes merged commit b35112c into main Sep 2, 2021
@bmhughes bmhughes deleted the detjensrobert/selinux-policy-merger branch September 2, 2021 18:59
@kitchen-porter
Copy link
Contributor

Released as: 6.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release: Major Release to Chef Supermarket as a major change when merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants