-
-
Save ahendrix/9396937 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
# 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" | |
# TODO: assert that /var/run/reboot-required contains a string | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment