vagrantup 0.9.99.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -1
- data/config/default.rb +0 -1
- data/lib/vagrant.rb +5 -1
- data/lib/vagrant/action/vm/customize.rb +1 -1
- data/lib/vagrant/config/ssh.rb +0 -20
- data/lib/vagrant/config/vm.rb +0 -48
- data/lib/vagrant/data_store.rb +18 -9
- data/lib/vagrant/environment.rb +1 -1
- data/lib/vagrant/guest.rb +1 -0
- data/lib/vagrant/guest/fedora.rb +66 -0
- data/lib/vagrant/guest/freebsd.rb +18 -7
- data/lib/vagrant/guest/linux.rb +1 -0
- data/lib/vagrant/hosts.rb +1 -0
- data/lib/vagrant/hosts/opensuse.rb +30 -0
- data/lib/vagrant/provisioners/puppet.rb +14 -1
- data/lib/vagrant/util/subprocess.rb +9 -0
- data/lib/vagrant/version.rb +1 -1
- data/lib/vagrant/vm.rb +5 -5
- data/templates/guests/fedora/network_dhcp.erb +6 -0
- data/templates/guests/fedora/network_static.erb +13 -0
- data/templates/guests/freebsd/network_dhcp.erb +3 -0
- data/templates/guests/freebsd/network_static.erb +3 -0
- data/test/unit/vagrant/data_store_test.rb +12 -0
- data/test/unit/vagrant/environment_test.rb +20 -0
- metadata +7 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3304b65afaca240d89ee451787ce3866c934ba3c
|
4
|
+
data.tar.gz: 1b1626fddeb5369a91de4c1c7ba698c0a2bf280e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3387e49f37c3400b4ba9ae9c2dc62ca293f5aa71143225f2e2ea3c7f8af30db37b81494af98587cf890f80869b5857834a0ad2e2fbfeca9ca0a5b745cf6d4a2c
|
7
|
+
data.tar.gz: 2b32d38c8879d78f243f4d72b1e3f8600a701d6d3c8b77a7d22fdaec0664f03d2cb5d4e53ad292d5105682fc29bbf0f0401790549e3e9c0d1147e1777293fe13
|
data/CHANGELOG.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
## 1.0.0 (
|
1
|
+
## 1.0.0 (March 6, 2012)
|
2
2
|
|
3
3
|
- `vagrant gem` should now be used to install Vagrant plugins that are
|
4
4
|
gems. This installs the gems to a private gem folder that Vagrant adds
|
@@ -27,6 +27,17 @@
|
|
27
27
|
- NIC type can be defined for host-only network adapters. [GH-750]
|
28
28
|
- Fix issue where re-running chef-client would sometimes cause
|
29
29
|
problems due to file permissions. [GH-748]
|
30
|
+
- FreeBSD guests can now have their hostnames changed. [GH-757]
|
31
|
+
- FreeBSD guests now support host only networking and bridged networking. [GH-762]
|
32
|
+
- `VM#run_action` is now public so plugin-devs can hook into it.
|
33
|
+
- Fix crashing bug when attempting to run commands on the "primary"
|
34
|
+
VM in a multi-VM environment. [GH-761]
|
35
|
+
- With puppet you can now specify `:facter` as a dictionary of facts to
|
36
|
+
override what is generated by Puppet. [GH-753]
|
37
|
+
- Automatically convert all arguments to `customize` to strings.
|
38
|
+
- openSUSE host system. [GH-766]
|
39
|
+
- Fix subprocess IO deadlock which would occur on Windows. [GH-765]
|
40
|
+
- Fedora 16 guest support. [GH-772]
|
30
41
|
|
31
42
|
## 0.9.7 (February 9, 2012)
|
32
43
|
|
data/config/default.rb
CHANGED
data/lib/vagrant.rb
CHANGED
@@ -1,9 +1,10 @@
|
|
1
|
+
require 'log4r'
|
2
|
+
|
1
3
|
# Enable logging if it is requested. We do this before
|
2
4
|
# anything else so that we can setup the output before
|
3
5
|
# any logging occurs.
|
4
6
|
if ENV["VAGRANT_LOG"] && ENV["VAGRANT_LOG"] != ""
|
5
7
|
# Require Log4r and define the levels we'll be using
|
6
|
-
require 'log4r'
|
7
8
|
require 'log4r/config'
|
8
9
|
Log4r.define_levels(*Log4r::Log4rConfig::LogLevels)
|
9
10
|
|
@@ -52,6 +53,7 @@ require 'openssl'
|
|
52
53
|
|
53
54
|
# Always make the version available
|
54
55
|
require 'vagrant/version'
|
56
|
+
Log4r::Logger.new("vagrant::global").info("Vagrant version: #{Vagrant::VERSION}")
|
55
57
|
|
56
58
|
module Vagrant
|
57
59
|
autoload :Action, 'vagrant/action'
|
@@ -163,6 +165,7 @@ Vagrant.config_keys.register(:package) { Vagrant::Config::PackageConfig }
|
|
163
165
|
Vagrant.hosts.register(:arch) { Vagrant::Hosts::Arch }
|
164
166
|
Vagrant.hosts.register(:bsd) { Vagrant::Hosts::BSD }
|
165
167
|
Vagrant.hosts.register(:fedora) { Vagrant::Hosts::Fedora }
|
168
|
+
Vagrant.hosts.register(:opensuse) { Vagrant::Hosts::OpenSUSE }
|
166
169
|
Vagrant.hosts.register(:freebsd) { Vagrant::Hosts::FreeBSD }
|
167
170
|
Vagrant.hosts.register(:gentoo) { Vagrant::Hosts::Gentoo }
|
168
171
|
Vagrant.hosts.register(:linux) { Vagrant::Hosts::Linux }
|
@@ -171,6 +174,7 @@ Vagrant.hosts.register(:windows) { Vagrant::Hosts::Windows }
|
|
171
174
|
# Register the built-in guests
|
172
175
|
Vagrant.guests.register(:arch) { Vagrant::Guest::Arch }
|
173
176
|
Vagrant.guests.register(:debian) { Vagrant::Guest::Debian }
|
177
|
+
Vagrant.guests.register(:fedora) { Vagrant::Guest::Fedora }
|
174
178
|
Vagrant.guests.register(:freebsd) { Vagrant::Guest::FreeBSD }
|
175
179
|
Vagrant.guests.register(:gentoo) { Vagrant::Guest::Gentoo }
|
176
180
|
Vagrant.guests.register(:linux) { Vagrant::Guest::Linux }
|
data/lib/vagrant/config/ssh.rb
CHANGED
@@ -13,26 +13,6 @@ module Vagrant
|
|
13
13
|
attr_accessor :forward_x11
|
14
14
|
attr_accessor :shell
|
15
15
|
|
16
|
-
def forwarded_port_key=(value)
|
17
|
-
raise Errors::DeprecationError, :message => <<-MESSAGE
|
18
|
-
`config.ssh.forwarded_port_key` is now gone. You must now use
|
19
|
-
`config.ssh.guest_port` which is expected to be the port on the
|
20
|
-
guest that SSH is listening on. Vagrant will automatically scan
|
21
|
-
the forwarded ports to look for a forwarded port from this port
|
22
|
-
and use it.
|
23
|
-
MESSAGE
|
24
|
-
end
|
25
|
-
|
26
|
-
def forwarded_port_destination=(value)
|
27
|
-
raise Errors::DeprecationError, :message => <<-MESSAGE
|
28
|
-
`config.ssh.forwarded_port_destination` is now gone. You must now use
|
29
|
-
`config.ssh.guest_port` which is expected to be the port on the
|
30
|
-
guest that SSH is listening on. Vagrant will automatically scan
|
31
|
-
the forwarded ports to look for a forwarded port from this port
|
32
|
-
and use it.
|
33
|
-
MESSAGE
|
34
|
-
end
|
35
|
-
|
36
16
|
def validate(env, errors)
|
37
17
|
[:username, :host, :max_tries, :timeout].each do |field|
|
38
18
|
errors.add(I18n.t("vagrant.config.common.error_empty", :field => field)) if !instance_variable_get("@#{field}".to_sym)
|
data/lib/vagrant/config/vm.rb
CHANGED
@@ -39,28 +39,7 @@ module Vagrant
|
|
39
39
|
result
|
40
40
|
end
|
41
41
|
|
42
|
-
def system=(value)
|
43
|
-
raise Errors::DeprecationError, :message => <<-MESSAGE
|
44
|
-
`config.vm.system` has changed to `config.vm.guest` in Vagrant 0.9,
|
45
|
-
since this is more clear about the use of the configuration key.
|
46
|
-
Please change all references of `config.vm.system` to `config.vm.guest`.
|
47
|
-
MESSAGE
|
48
|
-
end
|
49
|
-
|
50
42
|
def forward_port(guestport, hostport, options=nil)
|
51
|
-
if !guestport.kind_of?(Integer)
|
52
|
-
raise Errors::DeprecationError, :message => <<-MESSAGE
|
53
|
-
`config.vm.forward_port` changed in 0.9.0 where the required name
|
54
|
-
argument is now removed. Vagrant will now automatically generate
|
55
|
-
a unique name for your forwarded port. For example, to forward
|
56
|
-
port 80 to port 8080 you now do the following:
|
57
|
-
|
58
|
-
config.vm.forward_port 80, 8080
|
59
|
-
|
60
|
-
Please change your configurations to match this new syntax.
|
61
|
-
MESSAGE
|
62
|
-
end
|
63
|
-
|
64
43
|
@forwarded_ports << {
|
65
44
|
:name => "#{guestport.to_s(32)}-#{hostport.to_s(32)}",
|
66
45
|
:guestport => guestport,
|
@@ -85,19 +64,6 @@ Please change your configurations to match this new syntax.
|
|
85
64
|
end
|
86
65
|
|
87
66
|
def network(type, *args)
|
88
|
-
if !type.kind_of?(Symbol)
|
89
|
-
raise Errors::DeprecationError, :message => <<-MESSAGE
|
90
|
-
`config.vm.network` changed in 0.9.0 where the first argument is
|
91
|
-
now the type of network and the remaining arguments are options for
|
92
|
-
that type. For example, host only networks are now configured like
|
93
|
-
so:
|
94
|
-
|
95
|
-
config.vm.network :hostonly, "172.24.24.24"
|
96
|
-
|
97
|
-
Please change your configurations to match this new syntax.
|
98
|
-
MESSAGE
|
99
|
-
end
|
100
|
-
|
101
67
|
@networks << [type, args]
|
102
68
|
end
|
103
69
|
|
@@ -109,20 +75,6 @@ Please change your configurations to match this new syntax.
|
|
109
75
|
# It is only defaulted to nil so that the deprecation error
|
110
76
|
# can be properly shown.
|
111
77
|
def customize(command=nil)
|
112
|
-
if block_given?
|
113
|
-
raise Errors::DeprecationError, :message => <<-MESSAGE
|
114
|
-
`config.vm.customize` now takes an array of arguments to send to
|
115
|
-
`VBoxManage` instead of having a block which gets a virtual machine
|
116
|
-
object. Example of the new usage:
|
117
|
-
|
118
|
-
config.vm.customize ["modifyvm", :id, "--memory", "1024"]
|
119
|
-
|
120
|
-
The above will run `VBoxManage modifyvm 1234 --memory 1024` where
|
121
|
-
"1234" is the ID of your current virtual machine. Anything you could
|
122
|
-
do before is certainly still possible with `VBoxManage` as well.
|
123
|
-
MESSAGE
|
124
|
-
end
|
125
|
-
|
126
78
|
@customizations << command if command
|
127
79
|
end
|
128
80
|
|
data/lib/vagrant/data_store.rb
CHANGED
@@ -21,25 +21,34 @@ module Vagrant
|
|
21
21
|
|
22
22
|
def initialize(file_path)
|
23
23
|
@logger = Log4r::Logger.new("vagrant::datastore")
|
24
|
-
@logger.info("Created: #{file_path}")
|
25
24
|
|
26
|
-
|
25
|
+
if file_path
|
26
|
+
@logger.info("Created: #{file_path}")
|
27
27
|
|
28
|
-
|
29
|
-
|
28
|
+
@file_path = Pathname.new(file_path)
|
29
|
+
if @file_path.exist?
|
30
|
+
raise Errors::DotfileIsDirectory if @file_path.directory?
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
32
|
+
begin
|
33
|
+
merge!(JSON.parse(@file_path.read))
|
34
|
+
rescue JSON::ParserError
|
35
|
+
# Ignore if the data is invalid in the file.
|
36
|
+
@logger.error("Data store contained invalid JSON. Ignoring.")
|
37
|
+
end
|
36
38
|
end
|
39
|
+
else
|
40
|
+
@logger.info("No file path. In-memory data store.")
|
41
|
+
@file_path = nil
|
37
42
|
end
|
38
43
|
end
|
39
44
|
|
40
45
|
# Commits any changes to the data to disk. Even if the data
|
41
46
|
# hasn't changed, it will be reserialized and written to disk.
|
42
47
|
def commit
|
48
|
+
if !@file_path
|
49
|
+
raise StandardError, "In-memory data stores can't be committed."
|
50
|
+
end
|
51
|
+
|
43
52
|
clean_nil_and_empties
|
44
53
|
|
45
54
|
if empty?
|
data/lib/vagrant/environment.rb
CHANGED
data/lib/vagrant/guest.rb
CHANGED
@@ -5,6 +5,7 @@ module Vagrant
|
|
5
5
|
# Specific guests
|
6
6
|
autoload :Arch, 'vagrant/guest/arch'
|
7
7
|
autoload :Debian, 'vagrant/guest/debian'
|
8
|
+
autoload :Fedora, 'vagrant/guest/fedora'
|
8
9
|
autoload :FreeBSD, 'vagrant/guest/freebsd'
|
9
10
|
autoload :Gentoo, 'vagrant/guest/gentoo'
|
10
11
|
autoload :Linux, 'vagrant/guest/linux'
|
@@ -0,0 +1,66 @@
|
|
1
|
+
require 'set'
|
2
|
+
require 'tempfile'
|
3
|
+
|
4
|
+
require 'vagrant/util/template_renderer'
|
5
|
+
|
6
|
+
module Vagrant
|
7
|
+
module Guest
|
8
|
+
class Fedora < Linux
|
9
|
+
# Make the TemplateRenderer top-level
|
10
|
+
include Vagrant::Util
|
11
|
+
|
12
|
+
def configure_networks(networks)
|
13
|
+
# Accumulate the configurations to add to the interfaces file as well
|
14
|
+
# as what interfaces we're actually configuring since we use that later.
|
15
|
+
interfaces = Set.new
|
16
|
+
networks.each do |network|
|
17
|
+
interfaces.add(network[:interface])
|
18
|
+
|
19
|
+
# Remove any previous vagrant configuration in this network
|
20
|
+
# interface's configuration files.
|
21
|
+
vm.channel.sudo("touch #{network_scripts_dir}/ifcfg-p7p#{network[:interface]}")
|
22
|
+
vm.channel.sudo("sed -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' #{network_scripts_dir}/ifcfg-p7p#{network[:interface]} > /tmp/vagrant-ifcfg-p7p#{network[:interface]}")
|
23
|
+
vm.channel.sudo("cat /tmp/vagrant-ifcfg-p7p#{network[:interface]} > #{network_scripts_dir}/ifcfg-p7p#{network[:interface]}")
|
24
|
+
|
25
|
+
# Render and upload the network entry file to a deterministic
|
26
|
+
# temporary location.
|
27
|
+
entry = TemplateRenderer.render("guests/fedora/network_#{network[:type]}",
|
28
|
+
:options => network)
|
29
|
+
|
30
|
+
temp = Tempfile.new("vagrant")
|
31
|
+
temp.binmode
|
32
|
+
temp.write(entry)
|
33
|
+
temp.close
|
34
|
+
|
35
|
+
vm.channel.upload(temp.path, "/tmp/vagrant-network-entry_#{network[:interface]}")
|
36
|
+
end
|
37
|
+
|
38
|
+
# Bring down all the interfaces we're reconfiguring. By bringing down
|
39
|
+
# each specifically, we avoid reconfiguring p7p (the NAT interface) so
|
40
|
+
# SSH never dies.
|
41
|
+
interfaces.each do |interface|
|
42
|
+
vm.channel.sudo("/sbin/ifdown p7p#{interface} 2> /dev/null", :error_check => false)
|
43
|
+
vm.channel.sudo("cat /tmp/vagrant-network-entry_#{interface} >> #{network_scripts_dir}/ifcfg-p7p#{interface}")
|
44
|
+
vm.channel.sudo("/sbin/ifup p7p#{interface} 2> /dev/null")
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
# The path to the directory with the network configuration scripts.
|
49
|
+
# This is pulled out into its own directory since there are other
|
50
|
+
# operating systems (SuSE) which behave similarly but with a different
|
51
|
+
# path to the network scripts.
|
52
|
+
def network_scripts_dir
|
53
|
+
'/etc/sysconfig/network-scripts'
|
54
|
+
end
|
55
|
+
|
56
|
+
def change_host_name(name)
|
57
|
+
# Only do this if the hostname is not already set
|
58
|
+
if !vm.channel.test("sudo hostname | grep '#{name}'")
|
59
|
+
vm.channel.sudo("sed -i 's/\\(HOSTNAME=\\).*/\\1#{name}/' /etc/sysconfig/network")
|
60
|
+
vm.channel.sudo("hostname #{name}")
|
61
|
+
vm.channel.sudo("sed -i 's@^\\(127[.]0[.]0[.]1[[:space:]]\\+\\)@\\1#{name} #{name.split('.')[0]} @' /etc/hosts")
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'vagrant/util/template_renderer'
|
2
|
+
|
1
3
|
module Vagrant
|
2
4
|
module Guest
|
3
5
|
# A general Vagrant system implementation for "freebsd".
|
@@ -57,19 +59,28 @@ module Vagrant
|
|
57
59
|
end
|
58
60
|
|
59
61
|
def configure_networks(networks)
|
60
|
-
# Remove any previous
|
61
|
-
|
62
|
-
vm.channel.sudo("sed -e '/^#VAGRANT-BEGIN-HOSTONLY/,/^#VAGRANT-END-HOSTONLY/ d' /etc/rc.conf > /tmp/rc.conf")
|
63
|
-
vm.channel.sudo("mv /tmp/rc.conf /etc/rc.conf")
|
62
|
+
# Remove any previous network additions to the configuration file.
|
63
|
+
vm.channel.sudo("sed -i '' -e '/^#VAGRANT-BEGIN/,/^#VAGRANT-END/ d' /etc/rc.conf")
|
64
64
|
|
65
65
|
networks.each do |network|
|
66
|
-
entry = "#
|
66
|
+
entry = TemplateRenderer.render("guests/freebsd/network_#{network[:type]}",
|
67
|
+
:options => network)
|
67
68
|
vm.channel.upload(StringIO.new(entry), "/tmp/vagrant-network-entry")
|
68
|
-
|
69
69
|
vm.channel.sudo("su -m root -c 'cat /tmp/vagrant-network-entry >> /etc/rc.conf'")
|
70
|
-
|
70
|
+
if network[:type].to_sym == :static
|
71
|
+
vm.channel.sudo("ifconfig em#{network[:interface]} inet #{network[:ip]} netmask #{network[:netmask]}")
|
72
|
+
elsif network[:type].to_sym == :dhcp
|
73
|
+
vm.channel.sudo("dhclient em#{network[:interface]}")
|
74
|
+
end
|
71
75
|
end
|
72
76
|
end
|
77
|
+
|
78
|
+
def change_host_name(name)
|
79
|
+
if !vm.channel.test("hostname -f | grep '^#{name}$' || hostname -s | grep '^#{name}$'")
|
80
|
+
vm.channel.sudo("sed -i '' 's/^hostname=.*$/hostname=#{name}/' /etc/rc.conf")
|
81
|
+
vm.channel.sudo("hostname #{name}")
|
82
|
+
end
|
83
|
+
end
|
73
84
|
end
|
74
85
|
end
|
75
86
|
end
|
data/lib/vagrant/guest/linux.rb
CHANGED
@@ -19,6 +19,7 @@ module Vagrant
|
|
19
19
|
end
|
20
20
|
|
21
21
|
return :gentoo if @vm.channel.test("cat /etc/gentoo-release")
|
22
|
+
return :fedora if @vm.channel.test("grep 'Fedora release 16' /etc/redhat-release")
|
22
23
|
return :redhat if @vm.channel.test("cat /etc/redhat-release")
|
23
24
|
return :suse if @vm.channel.test("cat /etc/SuSE-release")
|
24
25
|
return :arch if @vm.channel.test("cat /etc/arch-release")
|
data/lib/vagrant/hosts.rb
CHANGED
@@ -7,6 +7,7 @@ module Vagrant
|
|
7
7
|
autoload :BSD, 'vagrant/hosts/bsd'
|
8
8
|
autoload :FreeBSD, 'vagrant/hosts/freebsd'
|
9
9
|
autoload :Fedora, 'vagrant/hosts/fedora'
|
10
|
+
autoload :OpenSUSE, 'vagrant/hosts/opensuse'
|
10
11
|
autoload :Gentoo, 'vagrant/hosts/gentoo'
|
11
12
|
autoload :Linux, 'vagrant/hosts/linux'
|
12
13
|
autoload :Windows, 'vagrant/hosts/windows'
|
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'pathname'
|
2
|
+
|
3
|
+
module Vagrant
|
4
|
+
module Hosts
|
5
|
+
class OpenSUSE < Linux
|
6
|
+
def self.match?
|
7
|
+
release_file = Pathname.new("/etc/SuSE-release")
|
8
|
+
|
9
|
+
if release_file.exist?
|
10
|
+
release_file.open("r") do |f|
|
11
|
+
return true if f.gets =~ /^openSUSE/
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
false
|
16
|
+
end
|
17
|
+
|
18
|
+
# Normal, mid-range precedence.
|
19
|
+
def self.precedence
|
20
|
+
5
|
21
|
+
end
|
22
|
+
|
23
|
+
def initialize(*args)
|
24
|
+
super
|
25
|
+
|
26
|
+
@nfs_server_binary = "/etc/init.d/nfsserver"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -13,11 +13,13 @@ module Vagrant
|
|
13
13
|
attr_accessor :module_path
|
14
14
|
attr_accessor :pp_path
|
15
15
|
attr_accessor :options
|
16
|
+
attr_accessor :facter
|
16
17
|
|
17
18
|
def manifest_file; @manifest_file || "default.pp"; end
|
18
19
|
def manifests_path; @manifests_path || "manifests"; end
|
19
20
|
def pp_path; @pp_path || "/tmp/vagrant-puppet"; end
|
20
21
|
def options; @options ||= []; end
|
22
|
+
def facter; @facter ||= {}; end
|
21
23
|
|
22
24
|
# Returns the manifests path expanded relative to the root path of the
|
23
25
|
# environment.
|
@@ -138,7 +140,18 @@ module Vagrant
|
|
138
140
|
options << @manifest_file
|
139
141
|
options = options.join(" ")
|
140
142
|
|
141
|
-
|
143
|
+
# Build up the custom facts if we have any
|
144
|
+
facter = ""
|
145
|
+
if !config.facter.empty?
|
146
|
+
facts = []
|
147
|
+
config.facter.each do |key, value|
|
148
|
+
facts << "FACTER_#{key}='#{value}'"
|
149
|
+
end
|
150
|
+
|
151
|
+
facter = "#{facts.join(" ")} "
|
152
|
+
end
|
153
|
+
|
154
|
+
command = "cd #{manifests_guest_path} && #{facter}puppet apply #{options}"
|
142
155
|
|
143
156
|
env[:ui].info I18n.t("vagrant.provisioners.puppet.running_puppet",
|
144
157
|
:manifest => @manifest_file)
|
@@ -171,6 +171,15 @@ module Vagrant
|
|
171
171
|
# Windows doesn't support non-blocking reads on
|
172
172
|
# file descriptors or pipes so we have to get
|
173
173
|
# a bit more creative.
|
174
|
+
|
175
|
+
# Check if data is actually ready on this IO device.
|
176
|
+
# We have to do this since `readpartial` will actually block
|
177
|
+
# until data is available, which can cause blocking forever
|
178
|
+
# in some cases.
|
179
|
+
results = IO.select([io], nil, nil, 1)
|
180
|
+
break if !results || results[0].empty?
|
181
|
+
|
182
|
+
# Read!
|
174
183
|
data << io.readpartial(READ_CHUNK_SIZE)
|
175
184
|
else
|
176
185
|
# Do a simple non-blocking read on the IO object
|
data/lib/vagrant/version.rb
CHANGED
data/lib/vagrant/vm.rb
CHANGED
@@ -128,10 +128,12 @@ module Vagrant
|
|
128
128
|
begin
|
129
129
|
@driver = Driver::VirtualBox.new(@uuid)
|
130
130
|
rescue Driver::VirtualBox::VMNotFound
|
131
|
-
# Clear the UUID since this VM doesn't exist.
|
132
|
-
# back into `reload!` but shouldn't ever result in infinite
|
133
|
-
# recursion since `@uuid` will be nil.
|
131
|
+
# Clear the UUID since this VM doesn't exist.
|
134
132
|
@uuid = nil
|
133
|
+
|
134
|
+
# Reset the driver. This shouldn't raise a VMNotFound since we won't
|
135
|
+
# feed it a UUID.
|
136
|
+
@driver = Driver::VirtualBox.new
|
135
137
|
end
|
136
138
|
end
|
137
139
|
|
@@ -181,8 +183,6 @@ module Vagrant
|
|
181
183
|
@_ui
|
182
184
|
end
|
183
185
|
|
184
|
-
protected
|
185
|
-
|
186
186
|
def run_action(name, options=nil)
|
187
187
|
options = {
|
188
188
|
:vm => self,
|
@@ -0,0 +1,13 @@
|
|
1
|
+
#VAGRANT-BEGIN
|
2
|
+
# The contents below are automatically generated by Vagrant. Do not modify.
|
3
|
+
NM_CONTROLLED=no
|
4
|
+
BOOTPROTO=static
|
5
|
+
ONBOOT=yes
|
6
|
+
IPADDR=<%= options[:ip] %>
|
7
|
+
NETMASK=<%= options[:netmask] %>
|
8
|
+
DEVICE=p7p<%= options[:interface] %>
|
9
|
+
<%= options[:gateway] ? "GATEWAY=#{options[:gateway]}" : '' %>
|
10
|
+
<%= options[:mac_address] ? "HWADDR=#{options[:mac_address]}" : '' %>
|
11
|
+
<%= options[:dns1] ? "DNS1=#{options[:dns1]}" : 'DNS1=8.8.4.4' %>
|
12
|
+
<%= options[:dns2] ? "DNS2=#{options[:dns2]}" : 'DNS1=8.8.8.8' %>
|
13
|
+
#VAGRANT-END
|
@@ -64,4 +64,16 @@ describe Vagrant::DataStore do
|
|
64
64
|
# The file should no longer exist
|
65
65
|
db_file.should_not be_exist
|
66
66
|
end
|
67
|
+
|
68
|
+
it "works if the DB file is nil" do
|
69
|
+
store = described_class.new(nil)
|
70
|
+
store[:foo] = "bar"
|
71
|
+
store[:foo].should == "bar"
|
72
|
+
end
|
73
|
+
|
74
|
+
it "throws an exception if attempting to commit a data store with no file" do
|
75
|
+
store = described_class.new(nil)
|
76
|
+
expect { store.commit }.
|
77
|
+
to raise_error(StandardError)
|
78
|
+
end
|
67
79
|
end
|
@@ -86,6 +86,26 @@ describe Vagrant::Environment do
|
|
86
86
|
end
|
87
87
|
end
|
88
88
|
|
89
|
+
describe "primary VM" do
|
90
|
+
it "should be the only VM if not a multi-VM environment" do
|
91
|
+
instance.primary_vm.should == instance.vms.values.first
|
92
|
+
end
|
93
|
+
|
94
|
+
it "should be the VM marked as the primary" do
|
95
|
+
environment = isolated_environment do |env|
|
96
|
+
env.vagrantfile(<<-VF)
|
97
|
+
Vagrant::Config.run do |config|
|
98
|
+
config.vm.define :foo
|
99
|
+
config.vm.define :bar, :primary => true
|
100
|
+
end
|
101
|
+
VF
|
102
|
+
end
|
103
|
+
|
104
|
+
env = environment.create_vagrant_env
|
105
|
+
env.primary_vm.should == env.vms[:bar]
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
89
109
|
describe "loading configuration" do
|
90
110
|
it "should load global configuration" do
|
91
111
|
environment = isolated_environment do |env|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vagrantup
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mitchell Hashimoto
|
@@ -348,6 +348,7 @@ files:
|
|
348
348
|
- lib/vagrant/guest/arch.rb
|
349
349
|
- lib/vagrant/guest/base.rb
|
350
350
|
- lib/vagrant/guest/debian.rb
|
351
|
+
- lib/vagrant/guest/fedora.rb
|
351
352
|
- lib/vagrant/guest/freebsd.rb
|
352
353
|
- lib/vagrant/guest/gentoo.rb
|
353
354
|
- lib/vagrant/guest/linux.rb
|
@@ -365,6 +366,7 @@ files:
|
|
365
366
|
- lib/vagrant/hosts/freebsd.rb
|
366
367
|
- lib/vagrant/hosts/gentoo.rb
|
367
368
|
- lib/vagrant/hosts/linux.rb
|
369
|
+
- lib/vagrant/hosts/opensuse.rb
|
368
370
|
- lib/vagrant/hosts/windows.rb
|
369
371
|
- lib/vagrant/plugin.rb
|
370
372
|
- lib/vagrant/provisioners.rb
|
@@ -406,6 +408,10 @@ files:
|
|
406
408
|
- templates/guests/arch/network_static.erb
|
407
409
|
- templates/guests/debian/network_dhcp.erb
|
408
410
|
- templates/guests/debian/network_static.erb
|
411
|
+
- templates/guests/fedora/network_dhcp.erb
|
412
|
+
- templates/guests/fedora/network_static.erb
|
413
|
+
- templates/guests/freebsd/network_dhcp.erb
|
414
|
+
- templates/guests/freebsd/network_static.erb
|
409
415
|
- templates/guests/gentoo/network_dhcp.erb
|
410
416
|
- templates/guests/gentoo/network_static.erb
|
411
417
|
- templates/guests/redhat/network_dhcp.erb
|