Created
May 18, 2009 01:46
-
-
Save macros/113260 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sysctl Mash.new unless attribute?("sysctl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Managed by chef | |
<% if @sysctl.length > 0 %> | |
<% @sysctl.each do |k,v| %> | |
<%= k %> = <%= v %> | |
<% end %> | |
<% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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