Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms


selinux (33) Versions 0.6.0

Manages SELinux policy state and rules.

cookbook 'selinux', '= 0.6.0'
cookbook 'selinux', '= 0.6.0', :supermarket
knife supermarket install selinux
knife supermarket download selinux
Quality -%


Provides recipes for manipulating SELinux policy enforcement state.


RHEL family distribution or other Linux system that uses SELinux.


Tested on RHEL 5.8, 6.3

Node Attributes

  • node['selinux']['state'] - The SELinux policy enforcement state. The state to set by default, to match the default SELinux state on RHEL. Can be "enforcing", "permissive", "disabled"



The selinux_state LWRP is used to manage the SELinux state on the system. It does this by using the setenforce command and rendering the /etc/selinux/config file from a template.


  • :nothing - default action, does nothing
  • :enforcing - Sets SELinux to enforcing.
  • :disabled - Sets SELinux to disabled.
  • :permissive - Sets SELinux to permissive.


The LWRP has no user-settable resource attributes.


Simply set SELinux to enforcing or permissive:

selinux_state "SELinux Enforcing" do
  action :enforcing

selinux_state "SELinux Permissive" do
  action :permissive

The action here is based on the value of the node['selinux']['state'] attribute, which we convert to lower-case and make a symbol to pass to the action.

selinux_state "SELinux #{node['selinux']['state'].capitalize}" do
  action node['selinux']['state'].downcase.to_sym


All the recipes now leverage the LWRP described above.


The default recipe will use the attribute node['selinux']['state'] in the selinux_state LWRP's action. By default, this will be :enforcing.


This recipe will use :enforcing as the selinux_state action.


This recipe will use :permissive as the selinux_state action.


This recipe will use :disabled as the selinux_state action.


By default, this cookbook will have SELinux enforcing by default, as the default recipe uses the node['selinux']['state'] attribute, which is "enforcing." This is in line with the policy of enforcing by default on RHEL family distributions.

This has complicated considerations when changing the default configuration of their systems, whether it is with automated configuration management or manually. Often, third party help forums and support sites recommend setting SELinux to "permissive." This cookbook can help with that, in two ways.

You can simply set the attribute in a role applied to the node:

name "base"
description "Base role applied to all nodes."
  "selinux" => {
    "state" => "permissive"

Or, you can apply the recipe to the run list (e.g., in a role):

name "base"
description "Base role applied to all nodes."


Add LWRP/Libraries for manipulating security contexts for files and services managed by Chef.

License and Author

Copyright:: 2011-2012, Opscode, Inc

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Dependent cookbooks

This cookbook has no specified dependencies.

Contingent cookbooks

abiquo Applicable Versions
base_install Applicable Versions
centos-test Applicable Versions
cloudless-box Applicable Versions
cloudstack_wrapper Applicable Versions
consul Applicable Versions
corosync-cookbook Applicable Versions
crenv Applicable Versions
dcos Applicable Versions
django_platform Applicable Versions
drupal-cookbook Applicable Versions
eucalyptus Applicable Versions
greysystems-mongodb Applicable Versions
hadoop Applicable Versions
hashicorp-vault Applicable Versions
hdp-cloud Applicable Versions
k8s Applicable Versions
kafka-cluster Applicable Versions
katello Applicable Versions
kube_cluster Applicable Versions
kubernetes Applicable Versions
linux-basic Applicable Versions
linux_basic Applicable Versions
mariadb Applicable Versions
nc_base Applicable Versions
openstack-block-storage Applicable Versions
openstack-common Applicable Versions
paramount Applicable Versions
realmd-sssd Applicable Versions
redisio Applicable Versions
spree Applicable Versions
tungsten Applicable Versions
wordpress Applicable Versions
zenoss Applicable Versions
zookeeper-cluster Applicable Versions

No quality metric results found