knife-solo 0.0.9 → 0.0.10

Sign up to get free protection for your applications and to get access to all the features.
@@ -113,7 +113,7 @@ class Chef
113
113
 
114
114
  $ruby_bin -rubygems -e "gem 'chef', '#{constraint}'"
115
115
  BASH
116
- raise "The chef gem on #{host} is out of date. Please run `#{$0} prepare #{ssh_args}` to upgrade Chef to #{constraint}." unless result.success?
116
+ raise "Couldn't find Chef #{constraint} on #{host}. Please run `#{$0} prepare #{ssh_args}` to ensure Chef is installed and up to date." unless result.success?
117
117
  end
118
118
 
119
119
  def cook
@@ -5,11 +5,11 @@ class Chef
5
5
  class Kitchen < Knife
6
6
  include FileUtils
7
7
 
8
- banner "knife kitchen NAME"
8
+ banner "knife kitchen NAME or initialize current directory with '.'"
9
9
 
10
10
  def run
11
11
  name = @name_args.first
12
- mkdir name
12
+ mkdir name if name != '.'
13
13
  %w(nodes roles data_bags site-cookbooks cookbooks).each do |dir|
14
14
  mkdir name + "/#{dir}"
15
15
  touch name + "/#{dir}/.gitkeep"
@@ -0,0 +1,20 @@
1
+ require 'chef/knife'
2
+ require 'knife-solo/ssh_command'
3
+ require 'knife-solo/kitchen_command'
4
+
5
+ class Chef
6
+ class Knife
7
+ class WashUp < Knife
8
+ include KnifeSolo::SshCommand
9
+ include KnifeSolo::KitchenCommand
10
+
11
+ banner "knife wash_up [user@]hostname"
12
+
13
+ def run
14
+ super
15
+ Chef::Config.from_file('solo.rb')
16
+ run_command "rm -rf #{Chef::Config.file_cache_path}"
17
+ end
18
+ end
19
+ end
20
+ end
@@ -60,6 +60,15 @@ module KnifeSolo
60
60
  run_command("sudo bash install.sh")
61
61
  end
62
62
 
63
+ def ubuntu_omnibus_install
64
+ omnibus_install
65
+ # Update to avoid out-of-date package caches
66
+ run_command("sudo apt-get update")
67
+ # Make sure we have rsync on builds that don't include it by default
68
+ # (observed on linode's ubuntu 10.04 images)
69
+ run_command("sudo apt-get install rsync")
70
+ end
71
+
63
72
  def gem_install
64
73
  ui.msg "Installing rubygems from source..."
65
74
  release = "rubygems-1.8.10"
@@ -79,7 +79,7 @@ module KnifeSolo::Bootstraps
79
79
  {:type => "debian_gem", :version => "wheezy"}
80
80
  when %r{Ubuntu}
81
81
  version = run_command("lsb_release -cs").stdout.strip
82
- {:type => "debian_gem", :version => version}
82
+ {:type => "ubuntu_omnibus", :version => version}
83
83
  when %r{Linaro}
84
84
  version = run_command("lsb_release -cs").stdout.strip
85
85
  {:type => "debian_gem", :version => version}
@@ -1,5 +1,5 @@
1
1
  module KnifeSolo
2
2
  def self.version
3
- '0.0.9'
3
+ '0.0.10'
4
4
  end
5
5
  end
@@ -154,7 +154,7 @@ module KnifeSolo
154
154
  else
155
155
  replacement = ''
156
156
  end
157
- command.sub(/^\s*sudo/, replacement)
157
+ command.gsub(/sudo/, replacement)
158
158
  end
159
159
 
160
160
  def process_startup_file(command)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-solo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.0.10
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-05-14 00:00:00.000000000Z
12
+ date: 2012-05-30 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70342129968000 !ruby/object:Gem::Requirement
16
+ requirement: &70171470744280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70342129968000
24
+ version_requirements: *70171470744280
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: mocha
27
- requirement: &70342129967580 !ruby/object:Gem::Requirement
27
+ requirement: &70171470743860 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70342129967580
35
+ version_requirements: *70171470743860
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: chef
38
- requirement: &70342129967080 !ruby/object:Gem::Requirement
38
+ requirement: &70171470743360 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.10.0
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70342129967080
46
+ version_requirements: *70171470743360
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: net-ssh
49
- requirement: &70342129966560 !ruby/object:Gem::Requirement
49
+ requirement: &70171470742840 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -57,7 +57,18 @@ dependencies:
57
57
  version: 2.3.0
58
58
  type: :runtime
59
59
  prerelease: false
60
- version_requirements: *70342129966560
60
+ version_requirements: *70171470742840
61
+ - !ruby/object:Gem::Dependency
62
+ name: librarian
63
+ requirement: &70171470742120 !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ~>
67
+ - !ruby/object:Gem::Version
68
+ version: 0.0.20
69
+ type: :runtime
70
+ prerelease: false
71
+ version_requirements: *70171470742120
61
72
  description: Handles bootstrapping, running chef solo, rsyncing cookbooks etc
62
73
  email: mat@schaffer.me
63
74
  executables: []
@@ -69,6 +80,7 @@ files:
69
80
  - lib/chef/knife/patches/parser.rb
70
81
  - lib/chef/knife/patches/search_patch.rb
71
82
  - lib/chef/knife/prepare.rb
83
+ - lib/chef/knife/wash_up.rb
72
84
  - lib/knife-solo/bootstraps/darwin.rb
73
85
  - lib/knife-solo/bootstraps/linux.rb
74
86
  - lib/knife-solo/bootstraps.rb