OpenBSD guest [GH-773]

This commit is contained in:
Mitchell Hashimoto 2012-03-10 14:03:09 -08:00
parent 8ea5e15b48
commit b38083fb9b
4 changed files with 23 additions and 0 deletions

View File

@ -14,6 +14,7 @@
- The `:facter` option now works for puppet server. [GH-790]
- The `--no-provision` and `--provision-with` flags are available to
`vagrant reload` now.
- `:openbsd` guest which supports only halting at the moment. [GH-773]
## 1.0.0 (March 6, 2012)

View File

@ -178,6 +178,7 @@ Vagrant.guests.register(:fedora) { Vagrant::Guest::Fedora }
Vagrant.guests.register(:freebsd) { Vagrant::Guest::FreeBSD }
Vagrant.guests.register(:gentoo) { Vagrant::Guest::Gentoo }
Vagrant.guests.register(:linux) { Vagrant::Guest::Linux }
Vagrant.guests.register(:openbsd) { Vagrant::Guest::OpenBSD }
Vagrant.guests.register(:redhat) { Vagrant::Guest::Redhat }
Vagrant.guests.register(:solaris) { Vagrant::Guest::Solaris }
Vagrant.guests.register(:suse) { Vagrant::Guest::Suse }

View File

@ -9,6 +9,7 @@ module Vagrant
autoload :FreeBSD, 'vagrant/guest/freebsd'
autoload :Gentoo, 'vagrant/guest/gentoo'
autoload :Linux, 'vagrant/guest/linux'
autoload :OpenBSD, 'vagrant/guest/openbsd'
autoload :Redhat, 'vagrant/guest/redhat'
autoload :Solaris, 'vagrant/guest/solaris'
autoload :Suse, 'vagrant/guest/suse'

View File

@ -0,0 +1,20 @@
module Vagrant
module Guest
class OpenBSD < Base
def halt
vm.channel.sudo("shutdown -p -h now")
# Wait until the VM's state is actually powered off. If this doesn't
# occur within a reasonable amount of time then simply return which
# will cause Vagrant to force kill the machine.
count = 0
while vm.state != :poweroff
count += 1
return if count >= 30
sleep 1
end
end
end
end
end