Created

Embed URL

HTTPS clone URL

SSH clone URL

You can clone with HTTPS or SSH.

Download Gist
View attributes-sysctl.rb
1 2 3 4 5 6 7 8 9 10 11 12 13
execute "sysctl" do
command "sysctl -n -e -q -p"
action :nothing
end
 
template "/etc/sysctl.conf" do
source "sysctl.conf.erb"
mode 0644
owner "root"
group "root"
variables( :sysctl => node[:sysctl] )
notifies :run, resources(:execute => "sysctl")
end
View attributes-sysctl.rb
1 2 3 4 5 6
# Managed by chef
<% if @sysctl.length > 0 %>
<% @sysctl.each do |k,v| %>
<%= k %> = <%= v %>
<% end %>
<% end %>
View attributes-sysctl.rb
1 2 3 4
define :sysctl do
key = params[:name]
@node[:sysctl][key] = params[:value]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.