knife-solo 0.3.0.pre4 → 0.3.0.pre5

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
2
  SHA1:
3
- metadata.gz: 904d74c337d53936e856d39cbba88504da008ba8
4
- data.tar.gz: 450ff917a4c869ed34b664083c00b15534281244
3
+ metadata.gz: 2d37c6392175177322d6f010c9d1ae3184ee810a
4
+ data.tar.gz: 1eace0bf587cca78a01689baf2f5f6491ad8bdf7
5
5
  SHA512:
6
- metadata.gz: 1ab1298a915aa64fdc6e5b84dafa6f7c792c6ad8ff279c9b02e96916c85140515f2b6e9a74d8d320f1f3fbf9f5f9441f24be54e4c93a07ce6740a0c398f595ae
7
- data.tar.gz: 2049637c24941db8f9828cb8fcf7b14f1e6e644944bfb9fca1ee79e4e8be50356e3d5b7f71ba2167949deaca532abd3f51058bafbbca90be3d4c7040b218b093
6
+ metadata.gz: 5d1f44be1d11cfce81ba1f2266ebe9d4a1054c934ae277dd74c180e3ae5ba8a7d731f53546ad1cfeb03d936b590c78f88999a33c92c22689a30f8b725b558c2a
7
+ data.tar.gz: 2eaa24623d945f97da180d39b38d96cbf92977f42c5d9f29c22beb7742cbb8a84bdfa4f93defb16b113497d774fb40eaa470f119b4d191911206665fa4a21bac
@@ -17,9 +17,12 @@
17
17
  * Prepare/bootstrap now installs the same version of Chef that the workstation is running ([186])
18
18
  * Switch `--omnibus-version` flag to `--bootstrap-version` ([185])
19
19
  * Support `--override-runlist` option ([204])
20
+ * Add proxy settings to the generated solo.rb ([254])
20
21
  * Support Fedora 18 and other new EL distros ([229], [51a581])
22
+ * Support CloudLinux ([262])
21
23
  * Drop support for openSUSE 11
22
24
  * Upgrade chef-solo-search to v0.4.0
25
+ * Add `--sudo-command` option to use custom remote 'sudo' command ([256])
23
26
 
24
27
  ## Fixes
25
28
 
@@ -38,6 +41,7 @@
38
41
  * Parse Chef version even if chef-solo command prints warnings ([235], [238])
39
42
  * Upgrade CentOS in integration tests to 5.8 and 6.3 ([237])
40
43
  * Default to `lsb_release` for detecting the Linux distro and add support for RHEL based systems where /etc/issue is modified ([234], [242])
44
+ * Create the directory for node_config if it does not exist ([253])
41
45
 
42
46
  ## Thanks to our contributors!
43
47
 
@@ -47,6 +51,8 @@
47
51
  * [Łukasz Dubiel][bambuchaAdm]
48
52
  * [kmdsbng][kmdsbng]
49
53
  * [Darshan Patil][dapatil]
54
+ * [Shin Tokiwa][tocky]
55
+ * [Sam Martin][searlm]
50
56
 
51
57
  [1]: https://github.com/matschaffer/knife-solo/issues/1
52
58
  [86]: https://github.com/matschaffer/knife-solo/issues/86
@@ -77,6 +83,10 @@
77
83
  [237]: https://github.com/matschaffer/knife-solo/issues/237
78
84
  [238]: https://github.com/matschaffer/knife-solo/issues/238
79
85
  [242]: https://github.com/matschaffer/knife-solo/issues/242
86
+ [253]: https://github.com/matschaffer/knife-solo/issues/253
87
+ [254]: https://github.com/matschaffer/knife-solo/issues/254
88
+ [256]: https://github.com/matschaffer/knife-solo/issues/256
89
+ [262]: https://github.com/matschaffer/knife-solo/issues/262
80
90
  [d21756]: https://github.com/matschaffer/knife-solo/commit/d21756
81
91
  [1d3485]: https://github.com/matschaffer/knife-solo/commit/1d3485
82
92
  [f43ba4]: https://github.com/matschaffer/knife-solo/commit/f43ba4
@@ -358,9 +368,11 @@ And a special thanks to [Teemu Matilainen][tmatilai] who is now on the list of d
358
368
  [rubiojr]: https://github.com/rubiojr
359
369
  [russellcardullo]: https://github.com/russellcardullo
360
370
  [ryandub]: https://github.com/ryandub
371
+ [searlm]: https://github.com/searlm
361
372
  [skyeagle]: https://github.com/skyeagle
362
373
  [smdern]: https://github.com/smdern
363
374
  [tknerr]: https://github.com/tknerr
364
375
  [tmatilai]: https://github.com/tmatilai
376
+ [tocky]: https://github.com/tocky
365
377
  [vjpr]: https://github.com/vjpr
366
378
  [zeph]: https://github.com/zeph
@@ -125,6 +125,17 @@ class Chef
125
125
  @cookbook_paths ||= expanded_config_paths(:cookbook_path) + [patch_cookbooks_path]
126
126
  end
127
127
 
128
+ def proxy_setting_keys
129
+ [:http_proxy, :https_proxy, :http_proxy_user, :http_proxy_pass, :no_proxy]
130
+ end
131
+
132
+ def proxy_settings
133
+ proxy_setting_keys.inject(Hash.new) do |ret, key|
134
+ ret[key] = Chef::Config[key] if Chef::Config[key]
135
+ ret
136
+ end
137
+ end
138
+
128
139
  def add_cookbook_path(path)
129
140
  path = expand_path path
130
141
  cookbook_paths.unshift(path) unless cookbook_paths.include?(path)
@@ -81,6 +81,8 @@ module KnifeSolo::Bootstraps
81
81
  {:type => "yum_omnibus"}
82
82
  when %r{Scientific Linux}
83
83
  {:type => "yum_omnibus"}
84
+ when %r{CloudLinux}
85
+ {:type => "yum_omnibus"}
84
86
  when %r{SUSE Linux Enterprise Server 1[12]}
85
87
  {:type => "omnibus"}
86
88
  when %r{openSUSE 12}
@@ -1,6 +1,6 @@
1
1
  module KnifeSolo
2
2
  def self.version
3
- '0.3.0.pre4'
3
+ '0.3.0.pre5'
4
4
  end
5
5
 
6
6
  def self.post_install_message
@@ -2,6 +2,7 @@ module KnifeSolo
2
2
  module NodeConfigCommand
3
3
 
4
4
  def self.load_deps
5
+ require 'fileutils'
5
6
  require 'pathname'
6
7
  end
7
8
 
@@ -51,6 +52,7 @@ module KnifeSolo
51
52
  Chef::Log.debug "Node config '#{node_config}' already exists"
52
53
  else
53
54
  ui.msg "Generating node config '#{node_config}'..."
55
+ FileUtils.mkdir_p(node_config.dirname)
54
56
  File.open(node_config, 'w') do |f|
55
57
  attributes = config[:json_attributes] || config[:first_boot_attributes] || {}
56
58
  run_list = { :run_list => config[:run_list] || [] }
@@ -9,3 +9,7 @@ cookbook_path []
9
9
  <% cookbook_paths.each_with_index do |path, i| -%>
10
10
  cookbook_path << File.join(base, 'cookbooks-<%= i+1 %>') # <%= path %>
11
11
  <% end -%>
12
+
13
+ <% proxy_settings.each_pair do |k, v| -%>
14
+ <%= k %> "<%= v %>"
15
+ <% end -%>
@@ -54,6 +54,11 @@ module KnifeSolo
54
54
  :short => '-s FILE',
55
55
  :long => '--startup-script FILE',
56
56
  :description => 'The startup script on the remote server containing variable definitions'
57
+
58
+ option :sudo_command,
59
+ :long => '--sudo-command SUDO_COMMAND',
60
+ :description => 'The command to use instead of sudo for admin privileges'
61
+
57
62
  end
58
63
  end
59
64
 
@@ -147,6 +152,10 @@ module KnifeSolo
147
152
  [host_arg, config_arg, ident_arg, port_arg].compact.join(' ')
148
153
  end
149
154
 
155
+ def sudo_command
156
+ config[:sudo_command]
157
+ end
158
+
150
159
  def startup_script
151
160
  config[:startup_script]
152
161
  end
@@ -187,7 +196,10 @@ module KnifeSolo
187
196
  end
188
197
 
189
198
  def process_sudo(command)
190
- if sudo_available?
199
+ if sudo_command
200
+ Chef::Log.debug("Using replacement sudo command: #{sudo_command}")
201
+ replacement = sudo_command
202
+ elsif sudo_available?
191
203
  replacement = 'sudo -p \'knife sudo password: \''
192
204
  else
193
205
  replacement = ''
@@ -118,6 +118,14 @@ class NodeConfigCommandTest < TestCase
118
118
  end
119
119
  end
120
120
 
121
+ def test_creates_the_nodes_directory_if_needed
122
+ outside_kitchen do
123
+ cmd = command(@host, "--node-name=mynode")
124
+ cmd.generate_node_config
125
+ assert cmd.node_config.exist?
126
+ end
127
+ end
128
+
121
129
  def command(*args)
122
130
  knife_command(DummyNodeConfigCommand, *args)
123
131
  end
@@ -77,6 +77,13 @@ class SoloCookTest < TestCase
77
77
  assert_equal "/some/other/path", cmd.cookbook_paths[2].to_s
78
78
  end
79
79
 
80
+ def test_sets_proxy_settings
81
+ Chef::Config[:http_proxy] = "http://proxy:3128"
82
+ Chef::Config[:no_proxy] = nil
83
+ conf = command.proxy_settings
84
+ assert_equal({ :http_proxy => "http://proxy:3128" }, conf)
85
+ end
86
+
80
87
  def test_does_not_run_berkshelf_if_no_berkfile
81
88
  in_kitchen do
82
89
  Berkshelf::Berksfile.any_instance.expects(:install).never
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-solo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.pre4
4
+ version: 0.3.0.pre5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Schaffer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-23 00:00:00.000000000 Z
11
+ date: 2013-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: berkshelf