rs_vagrant_shim 0.0.2 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -9,23 +9,24 @@ Install it
9
9
  Create a new project
10
10
 
11
11
  rs_vagrant_shim init a_new_project
12
+ cd a_new_project
12
13
 
13
- Add some stuff to the default runlist found at a_new_project/runlists/default/default.json
14
+ Add some stuff to the default runlist found at runlists/default/default.json
14
15
 
15
16
  Fire up the vagrant box
16
17
 
17
- bundle exec vagrant up default
18
+ bundle exec vagrant up
18
19
 
19
- Create some new runlists at a_new_project/runlists/default/new_runlist.json
20
+ Create some new runlists at runlists/default/new_runlist.json
20
21
 
21
- Run some of the other runlists by copying them to a_new_project/rs_vagrant_shim/default/dispatch
22
+ Run some of the other runlists by copying them to rs_vagrant_shim/default/dispatch
22
23
 
23
- cp a_new_project/runlists/default/new_runlist.json a_new_project/rs_vagrant_shim/default/dispatch/
24
- bundle exec vagrant provision default
24
+ cp runlists/default/new_runlist.json rs_vagrant_shim/default/dispatch/
25
+ bundle exec vagrant provision
25
26
 
26
27
  Or specifying a "runlist" environment variable
27
28
 
28
- runlist=new_runlist bundle exec vagrant provision default
29
+ runlist=new_runlist bundle exec vagrant provision
29
30
 
30
31
  === Multi VMs
31
32
 
@@ -26,6 +26,9 @@ module RsVagrantShim
26
26
  option :vmnames,
27
27
  :desc => "The name of one more many VMs to add to the Vagrantfile",
28
28
  :type => :array
29
+ option :storage,
30
+ :desc => "Sets up the VM(s) to have a 10GB storage volume attached on boot",
31
+ :type => :boolean
29
32
  def init(projectname)
30
33
  if File.directory? projectname
31
34
  puts "A directory named #{projectname} already exists, please specify a different project name"
@@ -58,6 +61,26 @@ Vagrant::Config.run do |config|
58
61
  chef.run_list_dir = "runlists/<%= vmname %>"
59
62
  chef.shim_dir = "rs_vagrant_shim/<%= vmname %>"
60
63
  end
64
+
65
+ <% if options[:storage] %>
66
+ hdd_file = "rs_vagrant_shim/<%= vmname %>/storage.vdi"
67
+ unless File.exists?(hdd_file)
68
+ <%= vmname %>_config.vm.customize [
69
+ "createhd",
70
+ "--filename", hdd_file,
71
+ "--size", 10240
72
+ ]
73
+ <%= vmname %>_config.vm.customize [
74
+ "storageattach",
75
+ :id,
76
+ "--storagectl", "SATA Controller",
77
+ "--port", 1,
78
+ "--type", "hdd",
79
+ "--medium", hdd_file
80
+ ]
81
+ end
82
+ <% end %>
83
+
61
84
  <% idx += 1 %>
62
85
  end
63
86
  <% end %>
@@ -66,7 +89,7 @@ end
66
89
 
67
90
  default_runlist_template = <<-EOF
68
91
  {
69
- "cloud": { "provider": "vagrant" },
92
+ "cloud": { "provider": "vagrant", "public_ips": [], "private_ips": [] },
70
93
  "rightscale": { "instance_uuid": "uuid-<%= box %>" },
71
94
  "run_list": [
72
95
  "recipe[rs_vagrant_shim]"
@@ -101,7 +124,7 @@ source :rubygems
101
124
 
102
125
  # This is probably a bad idea during dev, you might wanna consider specifying
103
126
  # a specific rs_vagrant_shim
104
- gem "rs_vagrant_shim", "~> 0.0.1"
127
+ gem "rs_vagrant_shim", "~> 0.1.0"
105
128
 
106
129
  gem "berkshelf", "~> 1.1"
107
130
  gem "vagrant", "~> 1.0.5"
@@ -36,6 +36,7 @@ module Vagrant
36
36
  errors.add(I18n.t("vagrant.config.rs_vagrant_shim.run_list_dir_missing")) if !@run_list_dir || @run_list_dir.empty?
37
37
 
38
38
  if @shim_dir && !@shim_dir.empty? && @run_list_dir && !@run_list_dir.empty?
39
+ node_js_file = File.join(Dir.pwd, @shim_dir, 'node.js')
39
40
  dispatch_dir = File.join(Dir.pwd, @shim_dir, 'dispatch')
40
41
  FileUtils.mkdir_p dispatch_dir unless File.directory? dispatch_dir
41
42
 
@@ -43,6 +44,10 @@ module Vagrant
43
44
 
44
45
  runlist = JSON.parse(File.read(File.join(Dir.pwd, @run_list_dir, 'default.json')))
45
46
 
47
+ if File.exist? node_js_file
48
+ runlist.merge! JSON.parse(File.read(node_js_file))["normal"]
49
+ end
50
+
46
51
  # A specified runlist trumps all, but still inherits from default
47
52
  if ENV['runlist']
48
53
  runlist_file = File.join(Dir.pwd, @run_list_dir, "#{ENV['runlist']}.json")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rs_vagrant_shim
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.1.0
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-01-14 00:00:00.000000000 Z
12
+ date: 2013-01-24 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: berkshelf
@@ -90,7 +90,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
90
90
  version: '0'
91
91
  segments:
92
92
  - 0
93
- hash: -4153397398819252318
93
+ hash: -2372396189431750141
94
94
  required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  none: false
96
96
  requirements:
@@ -99,7 +99,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  version: '0'
100
100
  segments:
101
101
  - 0
102
- hash: -4153397398819252318
102
+ hash: -2372396189431750141
103
103
  requirements: []
104
104
  rubyforge_project:
105
105
  rubygems_version: 1.8.24