kondate 0.4.15 → 0.5.0.pre1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 0ac22d810f77ed1c124e0a5ca44fd2cfad3f69c7
4
- data.tar.gz: d12c0af4905dd9484565f627b2b4b2c33c82488f
2
+ SHA256:
3
+ metadata.gz: d582ca92c0673516338ad04d23c7199f8c7b297ebc0749d8dced87d6a62fdada
4
+ data.tar.gz: 50de0a1fccc9742723f6b666024afcc307694b4411ef372ac3e8d3597a444051
5
5
  SHA512:
6
- metadata.gz: ead654f8988ba341765a80cfcaa64501d9be1ca010635aceee641112cbd1b8bc95430382e0c07b520aba5681c33a9460870ef0aeec5fac5b63a4c367b8875991
7
- data.tar.gz: 0e2d4a1a53eb22c2ae848f7f7dda78c869535ff5cc6ceaf5efba29ee1296ce929bedc7311468e58cf94834207186e8cf1a10c019f8468dd48c6a9292c1e8bcc9
6
+ metadata.gz: 186572e357a561fc3e237e988bf5227bc932002fb746e68eb5197513809b6e21b2a4bd287b1e10872cd810730d022b2cdb1ceec9713cd30f4d9860707d7a4f30
7
+ data.tar.gz: dc2c5a0b2d34548b6bca5582087c43182ebb27703658a967e0009cb2c280b33d4c15976b0fd83d112cb7f30c32c784610f525f2c738ce7272571c092faac2539
data/.gitignore CHANGED
@@ -19,3 +19,4 @@
19
19
  .vagrant
20
20
  .tags
21
21
  /bin/
22
+ /vendor/
@@ -1,3 +1,11 @@
1
+ # 0.5.0 (To be released)
2
+
3
+ Enhancements:
4
+
5
+ * Support --shell option of itamae
6
+ * Support --login-shell option of itamae
7
+ * Make configurable itamae-kondate and serverspec-kondate options on .kondate.conf
8
+
1
9
  # 0.4.15 (2018-02-01)
2
10
 
3
11
  Changes:
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:
@@ -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 = Kondate::Config.host_plugin.get_hosts(role)
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 @options[:vagrant]
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 @options[:debug]
159
- command << " --dry-run" if @options[:dry_run]
160
- command << " --profile=#{@options[:profile]}" if @options[:profile]
161
- command << " --recipe-graph=#{@options[:recipe_graph]}" if @options[: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 @options[:vagrant]
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?
@@ -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,
@@ -1,3 +1,3 @@
1
1
  module Kondate
2
- VERSION = "0.4.15"
2
+ VERSION = "0.5.0.pre1"
3
3
  end
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.15
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-02-01 00:00:00.000000000 Z
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: '0'
204
+ version: 1.3.1
205
205
  requirements: []
206
206
  rubyforge_project:
207
- rubygems_version: 2.6.13
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.