chef-solo-wrapper 0.0.2 → 0.0.3

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.
Files changed (2) hide show
  1. data/bin/cs +19 -2
  2. metadata +19 -6
data/bin/cs CHANGED
@@ -16,7 +16,7 @@
16
16
  # See the License for the specific language governing permissions and
17
17
  # limitations under the License.
18
18
 
19
- CHEF_SOLO_WRAPPER_VERSION = '0.0.2'
19
+ CHEF_SOLO_WRAPPER_VERSION = '0.0.3'
20
20
 
21
21
  require 'rubygems'
22
22
  require 'trollop'
@@ -36,6 +36,7 @@ EOS
36
36
  opt :config, "Use alternate Chef Solo configuration (default used, ~/solo.rb.)", :short => "-c" # flag --config, default false
37
37
  opt :json, "Use alternate Chef Solo JSON data (default used, ~/node.json.)", :short => "-j", :type => String # flag --json, default false
38
38
  opt :test, "Tests requiring chef only plus implies a dry run", :short => "-t" # flag --test, default false
39
+ opt :setup, "Installs the Chef Rubygem." # flag --test, default false
39
40
  opt :dry, "Dry run only, don't run chef-solo.", :short => "-d" # flag --dry, default false
40
41
  opt :run, "Use alernative run_list for chef-solo run.", :short => "-r", :type => String # flag --run, default false
41
42
  opt :write, "Write back to local JSON file.", :short => "-w" # flag --write, default false
@@ -62,6 +63,22 @@ if opts.test
62
63
  exit
63
64
  end
64
65
 
66
+ if opts.setup
67
+ begin
68
+ puts 'Installing Chef RubyGem...'
69
+ system('gem install chef --no-rdoc --no-ri')
70
+ rescue
71
+ puts 'Failed to install Chef Rubygem!'
72
+ exit 1
73
+ end
74
+ puts 'Chef successfully installed.'
75
+ puts 'Install rest_connection (y/n)?'
76
+ install_rc = false
77
+ install_rc = gets.chomp
78
+ ( puts 'Installing rest_connection RubyGem...'; system('gem install rest_connection --no-rdoc --no-ri') ) unless install_rc != 'y'
79
+ exit
80
+ end
81
+
65
82
  # ensure a solo.rb exists for run
66
83
  if File.file?('/etc/chef/solo.rb')
67
84
  solo = '/etc/chef/solo.rb'
@@ -182,7 +199,7 @@ chef_json = " -j #{opts.json}" unless !opts.json
182
199
 
183
200
  # depict if sandbox chef-solo binary is used
184
201
  if opts.sandbox
185
- cs = '/opt/rightscale/sandbox/bin/chef-solo'
202
+ cs = '/opt/rightscale/sandbox/bin/ruby /opt/rightscale/sandbox/bin/chef-solo'
186
203
  else
187
204
  cs = 'chef-solo'
188
205
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-solo-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Fordham
@@ -15,9 +15,22 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2012-05-29 00:00:00 Z
19
- dependencies: []
20
-
18
+ date: 2012-06-02 00:00:00 Z
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: json
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
24
+ none: false
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ hash: 3
29
+ segments:
30
+ - 0
31
+ version: "0"
32
+ type: :runtime
33
+ version_requirements: *id001
21
34
  description: A basic wrapper for chef-solo with RightScale integration.
22
35
  email: chris@xhost.com.au
23
36
  executables: