OSDN Git Service

adds the `ssl_cert` cookbook dependency. lxcs-0.1.6
authorwhitestar <whitestar@gaea.test>
Sun, 19 Feb 2017 12:23:05 +0000 (21:23 +0900)
committerwhitestar <whitestar@gaea.test>
Sun, 19 Feb 2017 12:23:05 +0000 (21:23 +0900)
cookbooks/lxcs/Berksfile [new file with mode: 0644]
cookbooks/lxcs/CHANGELOG.md
cookbooks/lxcs/metadata.rb
cookbooks/lxcs/recipes/lxd.rb

diff --git a/cookbooks/lxcs/Berksfile b/cookbooks/lxcs/Berksfile
new file mode 100644 (file)
index 0000000..7e6ac6c
--- /dev/null
@@ -0,0 +1,21 @@
+#
+# Copyright 2017 whitestar
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# for ver. 3.x
+#source 'https://gpm00.grid.example.com:6280'
+source 'https://supermarket.chef.io'
+
+metadata
index 84ed0f2..519f654 100644 (file)
@@ -1,5 +1,9 @@
 # lxcs CHANGELOG
 
+0.1.6
+-----
+- adds the `ssl_cert` cookbook dependency.
+
 0.1.5
 -----
 - bug fix: LXD profile and network management.
index 620cb30..37cc4c0 100644 (file)
@@ -5,7 +5,7 @@ maintainer_email ''
 license          'Apache 2.0'
 description      'Installs/Configures LinuxContainers.org products'
 long_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))
-version          '0.1.5'
+version          '0.1.6'
 source_url       'http://scm.osdn.jp/gitroot/metasearch/grid-chef-repo.git'
 issues_url       'https://osdn.jp/projects/metasearch/ticket'
 
@@ -15,3 +15,4 @@ issues_url       'https://osdn.jp/projects/metasearch/ticket'
 supports 'ubuntu', '>= 16.04'
 
 depends 'platform_utils', '>= 0.3.1'
+depends 'ssl_cert', '>= 0.3.7'
index 2626c67..02265c8 100644 (file)
@@ -17,6 +17,8 @@
 # limitations under the License.
 #
 
+::Chef::Recipe.send(:include, SSLCert::Helper)
+
 lxd_conf = node['lxcs']['lxd']
 
 # Note: LXD itself does not require this directory.
@@ -56,17 +58,7 @@ if lxd_conf['init']['enabled']
   item_conf = lxd_conf['init']['trust_password_vault_item']
 
   unless item_conf.empty?
-    require 'chef-vault'
-    secret = ChefVault::Item.load(item_conf['vault'], item_conf['name'])
-    if item_conf.key?('env_context') && item_conf['env_context'] == true
-      secret = secret[node.chef_environment]
-    end
-    if !item_conf['key'].nil? && !item_conf['key'].empty?
-      item_conf['key'].split('/').each {|elm|
-        secret = secret[elm]
-      }
-    end
-
+    secret = get_vault_item_value(item_conf)
     opts += " --trust-password #{secret}"
   end