kondate 0.4.15 → 0.5.0.pre1
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 +5 -5
- data/.gitignore +1 -0
- data/CHANGELOG.md +8 -0
- data/README.md +23 -0
- data/lib/kondate/cli.rb +21 -7
- data/lib/kondate/config.rb +8 -0
- data/lib/kondate/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d582ca92c0673516338ad04d23c7199f8c7b297ebc0749d8dced87d6a62fdada
|
4
|
+
data.tar.gz: 50de0a1fccc9742723f6b666024afcc307694b4411ef372ac3e8d3597a444051
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 186572e357a561fc3e237e988bf5227bc932002fb746e68eb5197513809b6e21b2a4bd287b1e10872cd810730d022b2cdb1ceec9713cd30f4d9860707d7a4f30
|
7
|
+
data.tar.gz: dc2c5a0b2d34548b6bca5582087c43182ebb27703658a967e0009cb2c280b33d4c15976b0fd83d112cb7f30c32c784610f525f2c738ce7272571c092faac2539
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -115,6 +115,29 @@ host_plugin:
|
|
115
115
|
|
116
116
|
You can customize the directory tree with this conf.
|
117
117
|
|
118
|
+
#### Itamae options
|
119
|
+
|
120
|
+
You can configure itamae-kondate options on .kondate.conf, too as:
|
121
|
+
|
122
|
+
```
|
123
|
+
itamae_options:
|
124
|
+
shell: /bin/bash
|
125
|
+
```
|
126
|
+
|
127
|
+
See `itamae-kondate --help` for option list.
|
128
|
+
|
129
|
+
#### Serverspec options
|
130
|
+
|
131
|
+
You can configure serversepc-kondate options on .kondate.conf, too as:
|
132
|
+
|
133
|
+
```
|
134
|
+
itamae_options:
|
135
|
+
vagrant: true
|
136
|
+
```
|
137
|
+
|
138
|
+
See `serverspec-kondate --help` for option list.
|
139
|
+
|
140
|
+
|
118
141
|
### hosts.yml
|
119
142
|
|
120
143
|
The default uses `file` host plugin, and `hosts.yml`. The contents of `hosts.yml` look like below:
|
data/lib/kondate/cli.rb
CHANGED
@@ -57,6 +57,8 @@ module Kondate
|
|
57
57
|
option :vagrant, :type => :boolean, :default => false
|
58
58
|
option :profile, :type => :string, :default => nil, :desc => "[EXPERIMENTAL] Save profiling data", :banner => "PATH"
|
59
59
|
option :recipe_graph, :type => :string, :default => nil, :desc => "[EXPERIMENTAL] Write recipe dependency graph in DOT", :banner => "PATH"
|
60
|
+
option :shell, :type => :string, :default => Config.itamae_options[:shell] || "/bin/sh"
|
61
|
+
option :login_shell, :type => :boolean, :default => false
|
60
62
|
def itamae(host)
|
61
63
|
with_host(host) {|property_files| do_itamae(host, property_files) }
|
62
64
|
end
|
@@ -70,6 +72,8 @@ module Kondate
|
|
70
72
|
option :profile, :type => :string, :default => nil, :desc => "[EXPERIMENTAL] Save profiling data", :banner => "PATH"
|
71
73
|
option :recipe_graph, :type => :string, :default => nil, :desc => "[EXPERIMENTAL] Write recipe dependency graph in DOT", :banner => "PATH"
|
72
74
|
option :parallel, :aliases => ["-p"], :type => :numeric, :default => processor_count
|
75
|
+
option :shell, :type => :string, :default => Config.itamae_options[:shell] || "/bin/sh"
|
76
|
+
option :login_shell, :type => :boolean, :default => false
|
73
77
|
def itamae_role(role)
|
74
78
|
with_role(role) {|host, property_files| do_itamae(host, property_files) }
|
75
79
|
end
|
@@ -97,6 +101,14 @@ module Kondate
|
|
97
101
|
|
98
102
|
private
|
99
103
|
|
104
|
+
def itamae_options
|
105
|
+
@itamae_options ||= Config.itamae_options.merge(@options)
|
106
|
+
end
|
107
|
+
|
108
|
+
def serverspec_options
|
109
|
+
@serverspec_options ||= Config.serverspec_options.merge(@options)
|
110
|
+
end
|
111
|
+
|
100
112
|
def with_host(host, &block)
|
101
113
|
property_files = build_property_files(host)
|
102
114
|
begin
|
@@ -111,7 +123,7 @@ module Kondate
|
|
111
123
|
|
112
124
|
def with_role(role, &block)
|
113
125
|
$stdout.puts "Number of parallels is #{@options[:parallel]}"
|
114
|
-
hosts =
|
126
|
+
hosts = Config.host_plugin.get_hosts(role)
|
115
127
|
if hosts.nil? or hosts.empty?
|
116
128
|
$stderr.puts 'No host'
|
117
129
|
exit(1)
|
@@ -142,7 +154,7 @@ module Kondate
|
|
142
154
|
|
143
155
|
properties = property_file.load
|
144
156
|
|
145
|
-
if
|
157
|
+
if itamae_options[:vagrant]
|
146
158
|
command << " --vagrant"
|
147
159
|
else
|
148
160
|
# itamae itself sees Net:SSH::Config.for(host)
|
@@ -155,10 +167,12 @@ module Kondate
|
|
155
167
|
end
|
156
168
|
|
157
169
|
command << " -y #{property_file.path}"
|
158
|
-
command << " -l=debug" if
|
159
|
-
command << " --dry-run" if
|
160
|
-
command << " --profile=#{
|
161
|
-
command << " --recipe-graph=#{
|
170
|
+
command << " -l=debug" if itamae_options[:debug]
|
171
|
+
command << " --dry-run" if itamae_options[:dry_run]
|
172
|
+
command << " --profile=#{itamae_options[:profile]}" if itamae_options[:profile]
|
173
|
+
command << " --recipe-graph=#{itamae_options[:recipe_graph]}" if itamae_options[:recipe_graph]
|
174
|
+
command << " --shell=#{itamae_options[:shell]}" if itamae_options[:shell]
|
175
|
+
command << " --login-shell" if itamae_options[:login_shell]
|
162
176
|
command << " bootstrap.rb"
|
163
177
|
$stdout.puts "env #{env.map {|k, v| "#{k}=#{v.shellescape}" }.join(' ')} #{command}"
|
164
178
|
|
@@ -169,7 +183,7 @@ module Kondate
|
|
169
183
|
|
170
184
|
def do_serverspec(host, property_files)
|
171
185
|
env = {}
|
172
|
-
env['TARGET_VAGRANT'] = '1' if
|
186
|
+
env['TARGET_VAGRANT'] = '1' if serverspec_options[:vagrant]
|
173
187
|
env['RUBYOPT'] = "-I #{Config.plugin_dir} -r bundler/setup -r ext/serverspec/kondate"
|
174
188
|
property_files.each do |role, property_file|
|
175
189
|
next if property_file.empty?
|
data/lib/kondate/config.rb
CHANGED
@@ -33,6 +33,14 @@ module Kondate
|
|
33
33
|
@config_path ||= opts[:config] || ENV['KONDATE_CONFIG_PATH'] || DEFAULT_CONFIG_PATH
|
34
34
|
end
|
35
35
|
|
36
|
+
def itamae_options
|
37
|
+
@itamae_options ||= Thor::CoreExt::HashWithIndifferentAccess.new(config[:itamae_options] || {})
|
38
|
+
end
|
39
|
+
|
40
|
+
def serverspec_options
|
41
|
+
@serverspec_options ||= Thor::CoreExt::HashWithIndifferentAccess.new(config[:serverspec_options] || {})
|
42
|
+
end
|
43
|
+
|
36
44
|
def kondate_directories
|
37
45
|
{
|
38
46
|
'middleware_recipes_dir' => middleware_recipes_dir,
|
data/lib/kondate/version.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
|
+
version: 0.5.0.pre1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sonots
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-03-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: itamae
|
@@ -199,12 +199,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
199
199
|
version: '0'
|
200
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
201
|
requirements:
|
202
|
-
- - "
|
202
|
+
- - ">"
|
203
203
|
- !ruby/object:Gem::Version
|
204
|
-
version:
|
204
|
+
version: 1.3.1
|
205
205
|
requirements: []
|
206
206
|
rubyforge_project:
|
207
|
-
rubygems_version: 2.
|
207
|
+
rubygems_version: 2.7.4
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: Kondate is yet another nodes management framework for Itamae/Serverspec.
|