Skip to content

Instantly share code, notes, and snippets.

@mikehale
Created September 4, 2009 18:55
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mikehale/181044 to your computer and use it in GitHub Desktop.
Save mikehale/181044 to your computer and use it in GitHub Desktop.
A chef definition for installing kernel modules on ubuntu/debian.
# A chef definition for installing kernel modules on ubuntu/debian.
define :kernel_module, :action => :install do
if params[:action] == :install
bash "modprobe #{params[:name]}" do
code "modprobe #{params[:name]}"
not_if "lsmod |grep #{params[:name]}"
end
bash "install #{params[:name]} in /etc/modules" do
code "echo '#{params[:name]}' >> /etc/modules"
not_if "grep '^#{params[:name]}$' /etc/modules"
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment