chef-workflow 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,9 @@
1
+ * 0.2.2 March 12, 2013
2
+ * Vagrant box customizations via "customizations" attribute in
3
+ `configure_vagrant`. Takes an array of arrays that are injected into the
4
+ Vagrantfile as `vm.customize` lines. Patch by Greg Thornton.
5
+ * Fixes around Net::SSH use of sudo and PTYs.
6
+ * Some additional information about configuration in `chef-workflow-bootstrap`.
1
7
  * 0.2.1 February 20, 2013
2
8
  * Fixate JSON dependnecy to keep knife from breaking in bundles.
3
9
  * 0.2.0 February 8, 2013
@@ -67,6 +67,15 @@ end
67
67
  configure_vagrant do
68
68
  # if you wish to use a different box, supply it as a url here.
69
69
  # box_url "http://files.vagrantup.com/precise32.box"
70
+ #
71
+ # if you wish to customize the vms, such as modify the memory usage, use an
72
+ # array of arrays here. each inner array will be added to the vagrant files
73
+ # generated.
74
+ #
75
+ # example: customizations [ ["modifyvm", :id, "--memory", 1024] ]
76
+ #
77
+ # customizations nil
78
+ #
70
79
  end
71
80
 
72
81
  configure_knife do
@@ -97,7 +106,7 @@ configure_knife do
97
106
  # Note that you must have the 'minitest-handler' cookbook available on your
98
107
  # chef server for these to work.
99
108
  #
100
- # test_recipes []
109
+ # test_recipes [ ]
101
110
  end
102
111
 
103
112
  #
@@ -135,6 +144,9 @@ configure_ec2 do
135
144
  # need something more complicated, create your own groups by hand and set
136
145
  # `security_groups` above to those values.
137
146
  # security_group_open_ports [22, 4000]
147
+ #
148
+ # how long to wait for the ec2 API before giving up.
149
+ # provision_wait 300
138
150
  end
139
151
 
140
152
  #
@@ -34,7 +34,8 @@ module ChefWorkflow
34
34
  # heavy use of KnifeSupport to determine how to drive the command.
35
35
  #
36
36
  def configure_ssh_command(ip, command)
37
- command = "#{ChefWorkflow::KnifeSupport.use_sudo ? 'sudo ': ''}#{command}"
37
+ use_sudo = ChefWorkflow::KnifeSupport.use_sudo
38
+ command = "#{use_sudo ? 'sudo ': ''}#{command}"
38
39
 
39
40
  options = { }
40
41
 
@@ -43,6 +44,12 @@ module ChefWorkflow
43
44
 
44
45
  Net::SSH.start(ip, ChefWorkflow::KnifeSupport.ssh_user, options) do |ssh|
45
46
  ssh.open_channel do |ch|
47
+ ch.request_pty do |ch, success|
48
+ if !success and use_sudo
49
+ raise "The use_sudo setting requires a PTY, and your SSH is rejecting our attempt to get one."
50
+ end
51
+ end
52
+
46
53
  ch.on_open_failed do |ch, code, desc|
47
54
  raise "Connection Error to #{ip}: #{desc}"
48
55
  end
@@ -1,11 +1,13 @@
1
1
  require 'fileutils'
2
2
  require 'chef-workflow/support/generic'
3
+ require 'chef-workflow/support/attr'
3
4
 
4
5
  module ChefWorkflow
5
6
  #
6
7
  # Vagrant configuration settings. Uses `GenericSupport`.
7
8
  #
8
9
  class VagrantSupport
10
+ extend ChefWorkflow::AttrSupport
9
11
  include ChefWorkflow::GenericSupport
10
12
 
11
13
  # The default vagrant box we use for provisioning.
@@ -14,6 +16,8 @@ module ChefWorkflow
14
16
  # the calculated box, currently taken from the box_url. Expect this to change.
15
17
  attr_reader :box
16
18
 
19
+ fancy_attr :customizations
20
+
17
21
  #--
18
22
  # FIXME: support non-url boxes and ram configurations
19
23
  #++
@@ -70,6 +70,11 @@ module ChefWorkflow
70
70
  prison.configure do |config|
71
71
  config.vm.box_url = ChefWorkflow::VagrantSupport.box_url
72
72
  config.vm.box = ChefWorkflow::VagrantSupport.box
73
+
74
+ if customizations = ChefWorkflow::VagrantSupport.customizations
75
+ customizations.each { |c| config.vm.customize c }
76
+ end
77
+
73
78
  number_of_servers.times do |x|
74
79
  ip = ChefWorkflow::IPSupport.unused_ip
75
80
  ChefWorkflow::IPSupport.assign_role_ip(name, ip)
@@ -1,4 +1,4 @@
1
1
  module ChefWorkflow
2
2
  # The gem version.
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chef-workflow
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-02-21 00:00:00.000000000 Z
12
+ date: 2013-03-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: vagrant-prison
@@ -221,18 +221,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
221
221
  - - ! '>='
222
222
  - !ruby/object:Gem::Version
223
223
  version: '0'
224
- segments:
225
- - 0
226
- hash: 3946338268663345754
227
224
  required_rubygems_version: !ruby/object:Gem::Requirement
228
225
  none: false
229
226
  requirements:
230
227
  - - ! '>='
231
228
  - !ruby/object:Gem::Version
232
229
  version: '0'
233
- segments:
234
- - 0
235
- hash: 3946338268663345754
236
230
  requirements: []
237
231
  rubyforge_project:
238
232
  rubygems_version: 1.8.25