OSDN Git Service

improves the `platform_utils::kernel_modules` recipe. platform_utils-0.4.4
authorwhitestar <whitestar@gaea.test>
Wed, 15 Feb 2017 11:31:25 +0000 (20:31 +0900)
committerwhitestar <whitestar@gaea.test>
Wed, 15 Feb 2017 11:31:25 +0000 (20:31 +0900)
cookbooks/platform_utils/CHANGELOG.md
cookbooks/platform_utils/libraries/helper.rb
cookbooks/platform_utils/metadata.rb
cookbooks/platform_utils/recipes/kernel_modules.rb

index 07e9cce..bcd2a8c 100644 (file)
@@ -1,6 +1,10 @@
 platform_utils CHANGELOG
 ========================
 
+0.4.4
+-----
+- improves the `platform_utils::kernel_modules` recipe.
+
 0.4.3
 -----
 - adds the `platform_utils::sysctl` recipe.
index ce335cb..cf8c770 100644 (file)
@@ -27,6 +27,14 @@ module PlatformUtils
 
     def load_kernel_module(mod_name)
       unless container_guest_node?
+        # for old distributions.
+        dir = '/etc/modules-load.d'
+        resources(directory: dir) rescue directory dir do
+          owner 'root'
+          group 'root'
+          mode '0755'
+        end
+
         exec_name = "load_#{mod_name}_kernel_module"
         resources(execute: exec_name) rescue execute exec_name do
           command "modprobe #{mod_name}"
index 0da5937..d1ac1a7 100644 (file)
@@ -5,7 +5,7 @@ maintainer_email ''
 license          'Apache 2.0'
 description      'Platform Utilities'
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version          '0.4.3'
+version          '0.4.4'
 source_url       'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
 issues_url       'https://osdn.jp/projects/metasearch/ticket'
 
index c1ecc67..29dac7d 100644 (file)
 
 ::Chef::Recipe.send(:include, PlatformUtils::Helper)
 
+# for old distributions.
+dir = '/etc/modules-load.d'
+resources(directory: dir) rescue directory dir do
+  owner 'root'
+  group 'root'
+  mode '0755'
+end
+
 node['platform_utils']['kernel_modules']['loaded_modules'].each {|mod_name|
   load_kernel_module(mod_name)
 }