kondate 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +15 -6
- data/lib/kondate/cli.rb +6 -2
- data/lib/kondate/config.rb +20 -0
- data/lib/kondate/templates/.kondate.conf +4 -0
- data/lib/kondate/templates/bootstrap.rb +10 -4
- data/lib/kondate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a431b57f1b6c036f09520ef851e7fd4b41a5329e
|
4
|
+
data.tar.gz: cb3ccc508f8f9ab2d7ef47e34291d4997578c5f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f6cf11acfe6ac73c2d53271a1c669a128c567e2d6a679ea931ab29e8f79c4aae713a3c48c3fb11686de7fe96d0cf09d167246f5d9c5a935a0cbc547ff8395abd
|
7
|
+
data.tar.gz: a1eeb1a1059e97cbc7150055c52414b70a9ffec2e70d957fb57eb3bc48a551957bf2ea7dc44afc1eeb580c535172525feb9c2eee8dfaa4d5a65e8a2781001b55
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -65,11 +65,6 @@ $ bundle exec kondate serverspec-role <role>
|
|
65
65
|
│ ├── nodes # host specific properties
|
66
66
|
│ ├── roles # role properties
|
67
67
|
│ └── environments # environment properties
|
68
|
-
├── secrets # manages secrets attributes such as passwords
|
69
|
-
│ └── properties
|
70
|
-
│ ├── nodes
|
71
|
-
│ ├── roles
|
72
|
-
│ └── environments
|
73
68
|
├── recipes # itamae recipes
|
74
69
|
│ ├── middleware # middleware recipes
|
75
70
|
│ │ └── base
|
@@ -80,7 +75,17 @@ $ bundle exec kondate serverspec-role <role>
|
|
80
75
|
│ └── base_spec.rb
|
81
76
|
├─ roles # role recipes specs
|
82
77
|
└── spec_helper.rb
|
83
|
-
|
78
|
+
├── secrets # manages secrets attributes such as passwords
|
79
|
+
│ ├── properties
|
80
|
+
│ │ ├── environments
|
81
|
+
│ │ ├── nodes
|
82
|
+
│ │ └── roles
|
83
|
+
│ ├── recipes
|
84
|
+
│ │ ├── middleware
|
85
|
+
│ │ └── roles
|
86
|
+
│ └── spec
|
87
|
+
│ ├── middleware
|
88
|
+
│ └── roles```
|
84
89
|
|
85
90
|
### .kondate.conf
|
86
91
|
|
@@ -94,6 +99,10 @@ roles_recipes_serverspec_dir: spec/roles
|
|
94
99
|
nodes_properties_dir: properties/nodes
|
95
100
|
roles_properties_dir: properties/roles
|
96
101
|
environments_properties_dir: properties/environments
|
102
|
+
secret_middlware_recipes_dir: secrets/recipes/middleware
|
103
|
+
secret_roles_recipes_dir: secrets/recipes/roles
|
104
|
+
secret_middleware_recipes_serverspec_dir: secrets/spec/middleware
|
105
|
+
secret_roles_recipes_serverspec_dir: secrets/spec/roles
|
97
106
|
secret_nodes_properties_dir: secrets/properties/nodes
|
98
107
|
secret_roles_properties_dir: secrets/properties/roles
|
99
108
|
secret_environments_properties_dir: secrets/properties/environments
|
data/lib/kondate/cli.rb
CHANGED
@@ -168,9 +168,13 @@ module Kondate
|
|
168
168
|
property_files.each do |role, property_file|
|
169
169
|
next if property_file.nil?
|
170
170
|
spec_files = property_file.load['attributes'].keys.map {|recipe|
|
171
|
-
File.join(Config.
|
171
|
+
secret_spec_file = File.join(Config.secret_middleware_recipes_serverspec_dir, "#{recipe}_spec.rb")
|
172
|
+
spec_file = File.join(Config.middleware_recipes_serverspec_dir, "#{recipe}_spec.rb")
|
173
|
+
File.exist?(secret_spec_file) ? secret_spec_file : spec_file
|
172
174
|
}.compact
|
173
|
-
|
175
|
+
secret_role_spec_file = RoleFile.explore(Config.secret_roles_recipes_serverspec_dir, role, "_spec.rb")
|
176
|
+
role_spec_file = RoleFile.explore(Config.roles_recipes_serverspec_dir, role, "_spec.rb")
|
177
|
+
spec_files << (File.exist?(secret_role_spec_file) ? secret_role_spec_file : role_spec_file)
|
174
178
|
spec_files.select! {|spec| File.exist?(spec) }
|
175
179
|
|
176
180
|
env['TARGET_HOST'] = host
|
data/lib/kondate/config.rb
CHANGED
@@ -42,6 +42,10 @@ module Kondate
|
|
42
42
|
'nodes_properties_dir' => nodes_properties_dir,
|
43
43
|
'roles_properties_dir' => roles_properties_dir,
|
44
44
|
'environments_properties_dir' => environments_properties_dir,
|
45
|
+
'secret_middleware_recipes_dir' => secret_middleware_recipes_dir,
|
46
|
+
'secret_roles_recipes_dir' => secret_roles_recipes_dir,
|
47
|
+
'secret_middleware_recipes_serverspec_dir' => secret_middleware_recipes_serverspec_dir,
|
48
|
+
'secret_roles_recipes_serverspec_dir' => secret_roles_recipes_serverspec_dir,
|
45
49
|
'secret_nodes_properties_dir' => secret_nodes_properties_dir,
|
46
50
|
'secret_roles_properties_dir' => secret_roles_properties_dir,
|
47
51
|
'secret_environments_properties_dir' => secret_environments_properties_dir,
|
@@ -76,6 +80,22 @@ module Kondate
|
|
76
80
|
config[:environments_properties_dir] || 'properties/environments'
|
77
81
|
end
|
78
82
|
|
83
|
+
def secret_middleware_recipes_dir
|
84
|
+
config[:secret_middleware_recipes_dir] || 'secrets/recipes/middleware'
|
85
|
+
end
|
86
|
+
|
87
|
+
def secret_roles_recipes_dir
|
88
|
+
config[:secret_roles_recipes_dir] || 'secrets/recipes/roles'
|
89
|
+
end
|
90
|
+
|
91
|
+
def secret_middleware_recipes_serverspec_dir
|
92
|
+
config[:secret_middleware_recipes_serverspec_dir] || 'secrets/spec/middleware'
|
93
|
+
end
|
94
|
+
|
95
|
+
def secret_roles_recipes_serverspec_dir
|
96
|
+
config[:secret_roles_recipes_serverspec_dir] || 'secrets/spec/roles'
|
97
|
+
end
|
98
|
+
|
79
99
|
def secret_nodes_properties_dir
|
80
100
|
config[:secret_nodes_properties_dir] || 'secrets/properties/nodes'
|
81
101
|
end
|
@@ -6,6 +6,10 @@ roles_recipes_serverspec_dir: spec/roles
|
|
6
6
|
nodes_properties_dir: properties/nodes
|
7
7
|
roles_properties_dir: properties/roles
|
8
8
|
environments_properties_dir: properties/environments
|
9
|
+
secret_middlware_recipes_dir: secrets/recipes/middleware
|
10
|
+
secret_roles_recipes_dir: secrets/recipes/roles
|
11
|
+
secret_middleware_recipes_serverspec_dir: secrets/spec/middleware
|
12
|
+
secret_roles_recipes_serverspec_dir: secrets/spec/roles
|
9
13
|
secret_nodes_properties_dir: secrets/properties/nodes
|
10
14
|
secret_roles_properties_dir: secrets/properties/roles
|
11
15
|
secret_environments_properties_dir: secrets/properties/environments
|
@@ -3,9 +3,15 @@ require 'kondate'
|
|
3
3
|
|
4
4
|
recipes = node['attributes'].keys
|
5
5
|
recipes.each do |recipe|
|
6
|
-
|
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)
|
7
9
|
end
|
8
|
-
|
9
|
-
|
10
|
-
|
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)
|
11
17
|
end
|
data/lib/kondate/version.rb
CHANGED