chef-solo-wrapper 0.0.4 → 0.0.5

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 +16 -1
  2. metadata +16 -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.4'
19
+ CHEF_SOLO_WRAPPER_VERSION = '0.0.5'
20
20
  COOKBOOKS_SRC_DEST = '/usr/src/chef-cookbooks'
21
21
 
22
22
  require 'rubygems'
@@ -38,6 +38,7 @@ EOS
38
38
  opt :json, "Use alternate Chef Solo JSON data (default used, ~/node.json.)", :short => "-j", :type => String # flag --json, default false
39
39
  opt :test, "Tests requiring chef only plus implies a dry run", :short => "-t" # flag --test, default false
40
40
  opt :setup, "Installs the Chef Rubygem.", :type => String # flag --test, default false
41
+ opt :install, "Installs tools such as Git.", :type => String # flag --test, default false
41
42
  opt :defaults, "Setups up configuration for default/initial.", :default => false # flag --test, default false
42
43
  opt :fetch, "Fetches cookbooks.", :short => "-f", :type => String # flag --fetch, default false
43
44
  opt :dry, "Dry run only, don't run chef-solo.", :short => "-d" # flag --dry, default false
@@ -79,6 +80,20 @@ if opts[:test]
79
80
  exit
80
81
  end
81
82
 
83
+ # Install tools routines
84
+ if opts[:install]
85
+ case opts[:install]
86
+ when 'git'
87
+ # requires chef
88
+ system('rm -Rf /usr/src/git*; rm -Rf /usr/src/chef-cookbooks/git*')
89
+ system("mkdir -p /usr/src/chef-cookbooks && wget --no-check-certificate https://github.com/opscode-cookbooks/git/tarball/master -O /usr/src/git_cookbook.tar && cd /usr/src && tar zxvf /usr/src/git_cookbook.tar && mv -v /usr/src/opscode-cookbooks-git-* /usr/src/chef-cookbooks/git")
90
+ File.open('/etc/chef/install_git.json', "w") {|f| f.write '{ "run_list": [ "recipe[git::default]" ] }' }
91
+ File.open('/etc/chef/install_git_solo.rb', "w") {|f| f.write 'file_cache_path "/var/chef-solo"'+"\n"+'cookbook_path [ "/usr/src/chef-cookbooks" ]'+"\n"'json_attribs "/etc/chef/node.json"'+"\n"}
92
+ system("chef-solo -c /etc/chef/install_git_solo.rb -j /etc/chef/install_git.json")
93
+ end
94
+ exit
95
+ end
96
+
82
97
  # Setup routines
83
98
  if opts[:setup]
84
99
  case opts[:setup]
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: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 4
10
- version: 0.0.4
9
+ - 5
10
+ version: 0.0.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Chris Fordham
@@ -25,10 +25,20 @@ dependencies:
25
25
  requirements:
26
26
  - - ">="
27
27
  - !ruby/object:Gem::Version
28
- hash: 3
28
+ hash: 15
29
29
  segments:
30
- - 0
31
- version: "0"
30
+ - 1
31
+ - 4
32
+ - 4
33
+ version: 1.4.4
34
+ - - <=
35
+ - !ruby/object:Gem::Version
36
+ hash: 13
37
+ segments:
38
+ - 1
39
+ - 6
40
+ - 1
41
+ version: 1.6.1
32
42
  type: :runtime
33
43
  version_requirements: *id001
34
44
  - !ruby/object:Gem::Dependency