Comments (6)
The first part I agree with - I merged this when I wasn't that familiar with Ruby, and I will seperate to a different module.
I don't think I should leave the mixins to the cookbook users - I'll play around with using extend
at the instance level, like this:
action :add do
escaped_file_spec = Regexp.escape(new_resource.file_spec)
execute "selinux-fcontext-#{new_resource.secontext}-add" do
extend SELinuxPolicy::Helpers
command lazy { "/usr/sbin/semanage fcontext -a -t #{new_resource.secontext} '#{new_resource.file_spec}' && #{restorecon(new_resource.file_spec)}" }
not_if "/usr/sbin/semanage fcontext -l | grep -P '#{escaped_file_spec}\s.*\ssystem_u:object_r:#{new_resource.secontext}:s0'>/dev/null"
only_if {use_selinux}
end
end
from selinux_policy.
That doesn't help the situation with the install recipe though. Calling include
in your recipe isn't an unusual thing to do but I did get it slightly wrong above.
::Chef::Recipe.send(:include, SELinuxPolicy::Helpers)
include_recipe 'selinux_policy::install' if use_selinux
Not quite as nice but you can see this technique referenced here. Using extend
instead does work though as explained here.
extend SELinuxPolicy::Helpers
include_recipe 'selinux_policy::install' if use_selinux
from selinux_policy.
I thought you were talking about how I'm using it in my own recipe. I now think you're referring to how you're utilizing it in your own recipes.
Are you suggesting creating a recipe that does the mixin
, so consumers can easily mixin for their own use, and avoid the mixin automatically (in case it breaks something elsewhere)?
from selinux_policy.
I was referring to how you are using it in your providers but also how it could be used in recipes for other cookbooks. I'll submit a pull request later to ensure we're on the same page.
from selinux_policy.
Great :)
I'm onboard for making the cookbook cleaner. Not sure about the mixin
recipe though.
On May 15, 2015 6:36 PM, "James Le Cuirot" [email protected] wrote:
I was referring to how you are using it in your providers but also how
it could be used in recipes for other cookbooks. I'll submit a pull request
later to ensure we're on the same page.—
Reply to this email directly or view it on GitHub
#22 (comment)
.
from selinux_policy.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from selinux_policy.
Related Issues (20)
- STDERR: find: paths must precede expression: 2>/dev/null HOT 13
- selinux_policy_boolean not persistent by default
- Amazon Linux 2 not supported HOT 5
- Dangerfile should use failure instead of fail HOT 1
- Remove .rubocop.yml with Dangerfile
- Update Changelog
- Run latest cookstyle
- Update builds to be parallel
- SE Port Management Fails on CentOS 8 HOT 2
- Amazon linux
- CentOS 8 Stream: selinux_policy_fcontext: Chef::Exceptions::InvalidCookbookVersion '8' does not match 'x.y.z' or 'x.y' HOT 1
- selinux_policy_module installation disallowed if selinux is disabled HOT 1
- Clarification on `allow_disabled` resource property
- The compat_resource cookbook has been deprecated HOT 2
- Continuous Integration Testing HOT 1
- sh: semanage: command not found HOT 7
- [BUG] CentOS 7.x find 4.5.11 has a fd leak in -execdir - Too many open files HOT 12
- ArgumentError with version 2.2.0 HOT 3
- setsebool - No such file or directory HOT 3
- RHEL 8 support? HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from selinux_policy.