Skip to content

Instantly share code, notes, and snippets.

@ahendrix
Forked from mikehale/kernel_module.rb
Last active August 29, 2015 13:57
Show Gist options
  • Select an option

  • Save ahendrix/9396937 to your computer and use it in GitHub Desktop.

Select an option

Save ahendrix/9396937 to your computer and use it in GitHub Desktop.

Revisions

  1. ahendrix revised this gist Mar 6, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions kernel_module.rb
    Original file line number Diff line number Diff line change
    @@ -10,6 +10,7 @@
    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
  2. mikehale created this gist Sep 4, 2009.
    15 changes: 15 additions & 0 deletions kernel_module.rb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,15 @@
    # 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