• R/O
  • HTTP
  • SSH
  • HTTPS

grid-chef-repo: Commit

Grid環境構築用のChefリポジトリです。


Commit MetaInfo

Revisiónaa66efbd549cbe710dd49fe3a71ba0c16ddc72b8 (tree)
Tiempo2017-01-29 17:31:46
Autorwhitestar <whitestar@gaea...>
Commiterwhitestar

Log Message

adds the platform_utils::sysctl recipe.

Cambiar Resumen

Diferencia incremental

--- a/cookbooks/platform_utils/CHANGELOG.md
+++ b/cookbooks/platform_utils/CHANGELOG.md
@@ -1,10 +1,14 @@
11 platform_utils CHANGELOG
22 ========================
33
4+0.4.3
5+-----
6+- adds the `platform_utils::sysctl` recipe.
7+
48 0.4.2
59 -----
6-- adds the `PlatformUtils::kernel_modules` recipe.
7-- adds the `PlatformUtils::kernel_user_namespace` recipe.
10+- adds the `platform_utils::kernel_modules` recipe.
11+- adds the `platform_utils::kernel_user_namespace` recipe.
812
913 0.4.1
1014 -----
--- a/cookbooks/platform_utils/README.md
+++ b/cookbooks/platform_utils/README.md
@@ -6,21 +6,22 @@ This cookbook provides platform utility recipes.
66 ## Contents
77
88 - [Requirements](#requirements)
9- - [Platforms](#platforms)
10- - [Packages](#packages)
11- - [Cookbooks](#cookbooks)
9+ - [Platforms](#platforms)
10+ - [Packages](#packages)
11+ - [Cookbooks](#cookbooks)
1212 - [Attributes](#attributes)
1313 - [Usage](#usage)
14- - [Recipes](#recipes)
15- - [platform_utils::default](#platform_utilsdefault)
16- - [platform_utils::crond (ver. 0.4.0 or later)](#platform_utilscrond-ver-040-or-later)
17- - [platform_utils::kernel_modules (ver. 0.4.2 or later)](#platform_utilskernel_modules-ver-042-or-later)
18- - [platform_utils::kernel_user_namespace (ver. 0.4.2 or later)](#platform_utilskernel_user_namespace-ver-042-or-later)
19- - [platform_utils::ntpd (ver. 0.4.0 or later)](#platform_utilsntpd-ver-040-or-later)
20- - [platform_utils::platform_update](#platform_utilsplatform_update)
21- - [platform_utils::subid](#platform_utilssubid)
22- - [platform_utils::sudo](#platform_utilssudo)
23- - [platform_utils::tcp_wrappers (ver. 0.4.0 or later)](#platform_utilstcp_wrappers-ver-040-or-later)
14+ - [Recipes](#recipes)
15+ - [platform_utils::default](#platform_utilsdefault)
16+ - [platform_utils::crond (ver. 0.4.0 or later)](#platform_utilscrond-ver-040-or-later)
17+ - [platform_utils::kernel_modules (ver. 0.4.2 or later)](#platform_utilskernel_modules-ver-042-or-later)
18+ - [platform_utils::kernel_user_namespace (ver. 0.4.2 or later)](#platform_utilskernel_user_namespace-ver-042-or-later)
19+ - [platform_utils::ntpd (ver. 0.4.0 or later)](#platform_utilsntpd-ver-040-or-later)
20+ - [platform_utils::platform_update](#platform_utilsplatform_update)
21+ - [platform_utils::subid](#platform_utilssubid)
22+ - [platform_utils::sudo](#platform_utilssudo)
23+ - [platform_utils::sysctl (ver. 0.4.3 or later)](#platform_utilssysctl-ver-043-or-later)
24+ - [platform_utils::tcp_wrappers (ver. 0.4.0 or later)](#platform_utilstcp_wrappers-ver-040-or-later)
2425 - [License and Authors](#license-and-authors)
2526
2627 ## Requirements
@@ -48,6 +49,7 @@ This cookbook provides platform utility recipes.
4849 |`['platform_utils']['subid']['notifies']`|Array, Hash|Notifies by the subordinate user/group file update.|`[]`, See `attributes/default.rb`|
4950 |`['platform_utils']['sudo']['sudoers.d']`|Hash|sudoers file configurations.|`{}` See `attributes/default.rb`|
5051 |`['platform_utils']['sudo']['group']['members']`|Array|Members appended to the `sudo` group.|`[]`|
52+|`['platform_utils']['sysctl']['configs']`|Hash|sysctl configurations. (ver. 0.4.3 or later)|`{}`, See `attributes/default.rb`|
5153 |`['platform_utils']['tcp_wrappers']['host_allow']`|Array|Entries in `/etc/hosts.allow` (ver. 0.4.0 or later)|`[]`|
5254 |`['platform_utils']['tcp_wrappers']['host_deny']`|Array|Entries in `/etc/hosts.deny` (ver. 0.4.0 or later)|`[]`|
5355
@@ -87,6 +89,10 @@ This recipe sets up the `/etc/subuid` and the `/etc/subgid`.
8789
8890 This recipe sets up sudo.
8991
92+#### platform_utils::sysctl (ver. 0.4.3 or later)
93+
94+This recipe sets up sysctl (Kernel parameters).
95+
9096 #### platform_utils::tcp_wrappers (ver. 0.4.0 or later)
9197
9298 This recipe sets up hosts.allow and hosts.deny.
--- a/cookbooks/platform_utils/attributes/default.rb
+++ b/cookbooks/platform_utils/attributes/default.rb
@@ -64,5 +64,19 @@ default['platform_utils']['sudo']['sudoers.d'] = {
6464 }
6565 default['platform_utils']['sudo']['group']['members'] = []
6666
67+default['platform_utils']['sysctl']['configs'] = {
68+=begin
69+ '80-by_chef' => {
70+ 'action' => :create,
71+ 'params' => {
72+ 'key' => 'value',
73+ },
74+ },
75+ '88-unwanted' => {
76+ 'action' => :delete,
77+ },
78+=end
79+}
80+
6781 default['platform_utils']['tcp_wrappers']['hosts_allow'] = []
6882 default['platform_utils']['tcp_wrappers']['hosts_deny'] = []
--- a/cookbooks/platform_utils/metadata.rb
+++ b/cookbooks/platform_utils/metadata.rb
@@ -5,7 +5,7 @@ maintainer_email ''
55 license 'Apache 2.0'
66 description 'Platform Utilities'
77 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
8-version '0.4.2'
8+version '0.4.3'
99 source_url 'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
1010 issues_url 'https://osdn.jp/projects/metasearch/ticket'
1111
--- /dev/null
+++ b/cookbooks/platform_utils/recipes/sysctl.rb
@@ -0,0 +1,44 @@
1+#
2+# Cookbook Name:: platform_utils
3+# Recipe:: sysctl
4+#
5+# Copyright 2017, whitestar
6+#
7+# Licensed under the Apache License, Version 2.0 (the "License");
8+# you may not use this file except in compliance with the License.
9+# You may obtain a copy of the License at
10+#
11+# http://www.apache.org/licenses/LICENSE-2.0
12+#
13+# Unless required by applicable law or agreed to in writing, software
14+# distributed under the License is distributed on an "AS IS" BASIS,
15+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+# See the License for the specific language governing permissions and
17+# limitations under the License.
18+#
19+
20+::Chef::Recipe.send(:include, PlatformUtils::VirtUtils)
21+
22+unless container_guest_node?
23+ node['platform_utils']['sysctl']['configs'].each {|file_name, conf|
24+ file_path = "/etc/sysctl.d/#{file_name}.conf"
25+ exec_name = "sysctl_-p_#{file_path}"
26+
27+ resources(execute: exec_name) rescue execute exec_name do
28+ command "sysctl -p #{file_path}"
29+ action :nothing
30+ end
31+
32+ resources(template: file_path) rescue template file_path do
33+ source 'etc/sysctl.d/template.conf'
34+ owner 'root'
35+ group 'root'
36+ mode '0644'
37+ variables(
38+ params: conf['params']
39+ )
40+ action conf['action'].to_sym
41+ notifies :run, "execute[#{exec_name}]", :immediately if conf['action'].to_sym == :create
42+ end
43+ }
44+end
--- /dev/null
+++ b/cookbooks/platform_utils/templates/default/etc/sysctl.d/template.conf
@@ -0,0 +1,3 @@
1+<% @params.each {|key, value| %>
2+<%= key %>=<%= value %>
3+<% } -%>
Show on old repository browser