kondate 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +2 -1
- data/lib/kondate/itamae_bootstrap.rb +48 -0
- data/lib/kondate/templates/bootstrap.rb +1 -15
- data/lib/kondate/version.rb +1 -1
- data/lib/kondate.rb +1 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54deb24b15782ee8fbbba818d19c6d493d0a5b2e
|
4
|
+
data.tar.gz: 492519e0f1d06fc38af99e5e576a4c7ded06451b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c3f87cc6ccf660587da86c2ef04b724623251cb0a6c3ddbf1d56106923609a2ea11c8419fa56e74dbe50b8112147236be93fd8f1a83600300d9d8d976d46d4ba
|
7
|
+
data.tar.gz: 6efaf410472520861cfe17e234e1d3ece626594ed4ba80fd6469c9afaaa1176d0405b2b2efb23d11aca2bd24899368b1bf0a637bf5fc42eec1d3eeba832407ba
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -0,0 +1,48 @@
|
|
1
|
+
module Kondate
|
2
|
+
class ItamaeBootstrap
|
3
|
+
# @param [Itamae::Recipe::EvalContext] context itamae context
|
4
|
+
def self.bootstrap(context)
|
5
|
+
self.new(context).bootstrap
|
6
|
+
end
|
7
|
+
|
8
|
+
# @param [Itamae::Recipe::EvalContext] context itamae context
|
9
|
+
def initialize(context)
|
10
|
+
@context = context
|
11
|
+
end
|
12
|
+
|
13
|
+
def bootstrap
|
14
|
+
bootstrap_middleware_recipes
|
15
|
+
bootstrap_role_recipes
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def node
|
21
|
+
@context.node
|
22
|
+
end
|
23
|
+
|
24
|
+
def include_recipe(recipe)
|
25
|
+
@context.include_recipe(recipe)
|
26
|
+
end
|
27
|
+
|
28
|
+
def bootstrap_middleware_recipes
|
29
|
+
recipes = node['attributes'].keys
|
30
|
+
recipes.each do |recipe|
|
31
|
+
secret_recipe_file = File.join(Config.secret_middleware_recipes_dir, recipe, "default.rb")
|
32
|
+
recipe_file = File.join(Config.middleware_recipes_dir, recipe, "default.rb")
|
33
|
+
File.exist?(secret_recipe_file) ? include_recipe(secret_recipe_file) : include_recipe(recipe_file)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def bootstrap_role_recipes
|
38
|
+
sep = File::SEPARATOR
|
39
|
+
secret_role_recipe_file = RoleFile.explore(Config.secret_roles_recipes_dir, node[:role], "#{sep}default.rb")
|
40
|
+
role_recipe_file = RoleFile.explore(Config.roles_recipes_dir, node[:role], "#{sep}default.rb")
|
41
|
+
if File.exist?(secret_role_recipe_file)
|
42
|
+
include_recipe(secret_role_recipe_file)
|
43
|
+
elsif File.exist?(role_recipe_file)
|
44
|
+
include_recipe(role_recipe_file)
|
45
|
+
end
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
@@ -1,17 +1,3 @@
|
|
1
|
-
require 'yaml'
|
2
1
|
require 'kondate'
|
3
2
|
|
4
|
-
|
5
|
-
recipes.each do |recipe|
|
6
|
-
secret_recipe_file = File.join(Kondate::Config.secret_middleware_recipes_dir, recipe, "default.rb")
|
7
|
-
recipe_file = File.join(Kondate::Config.middleware_recipes_dir, recipe, "default.rb")
|
8
|
-
File.exist?(secret_recipe_file) ? include_recipe(secret_recipe_file) : include_recipe(recipe_file)
|
9
|
-
end
|
10
|
-
sep = File::SEPARATOR
|
11
|
-
secret_role_recipe_file = Kondate::RoleFile.explore(Kondate::Config.secret_roles_recipes_dir, node[:role], "#{sep}default.rb")
|
12
|
-
role_recipe_file = Kondate::RoleFile.explore(Kondate::Config.roles_recipes_dir, node[:role], "#{sep}default.rb")
|
13
|
-
if File.exist?(secret_role_recipe_file)
|
14
|
-
include_recipe(secret_role_recipe_file)
|
15
|
-
elsif File.exist?(role_recipe_file)
|
16
|
-
include_recipe(role_recipe_file)
|
17
|
-
end
|
3
|
+
Kondate::ItamaeBootstrap.bootstrap(self)
|
data/lib/kondate/version.rb
CHANGED
data/lib/kondate.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kondate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sonots
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: itamae
|
@@ -176,6 +176,7 @@ files:
|
|
176
176
|
- lib/kondate/hash_ext.rb
|
177
177
|
- lib/kondate/host_plugin/base.rb
|
178
178
|
- lib/kondate/host_plugin/file.rb
|
179
|
+
- lib/kondate/itamae_bootstrap.rb
|
179
180
|
- lib/kondate/property_builder.rb
|
180
181
|
- lib/kondate/property_file.rb
|
181
182
|
- lib/kondate/role_file.rb
|