Allow setting container hostname from Vagrantfile

Closes #15
This commit is contained in:
Fabio Rehm 2013-03-03 02:37:34 -03:00
parent 30d163d4bb
commit 479f9a0cdc
3 changed files with 6 additions and 6 deletions

4
example/Vagrantfile vendored
View file

@ -4,7 +4,9 @@
Vagrant.require_plugin 'vagrant-lxc'
Vagrant.configure("2") do |config|
config.vm.box = "ubuntu-cloud"
config.vm.box = "ubuntu-cloud"
config.vm.hostname = 'ubuntu-cloud-box'
config.vm.provider :lxc do |lxc|
# ... soon to come lxc configs...
end

View file

@ -50,7 +50,6 @@ module Vagrant
b.use ShareFolders
b.use Network
b.use ForwardPorts
b.use HostName
b.use SaneDefaults
b.use Customize
b.use Boot
@ -87,6 +86,7 @@ module Vagrant
end
b.use action_start
b.use AfterCreate
b.use Vagrant::Action::Builtin::SetHostname
end
end
@ -122,7 +122,7 @@ module Vagrant
next
end
# TODO: Implement our own DestroyConfirm or propose a builtin action for Vagrant core
# TODO: Implement our own DestroyConfirm
b2.use Vagrant::Action::Builtin::Call, VagrantPlugins::ProviderVirtualBox::Action::DestroyConfirm do |env2, b3|
if env2[:result]
b3.use Vagrant::Action::Builtin::ConfigValidate
@ -132,7 +132,7 @@ module Vagrant
# TODO: VirtualBox provider has a CleanMachineFolder action, do we need something similar?
# TODO: VirtualBox provider has a DestroyUnusedNetworkInterfaces action, do we need something similar?
else
# TODO: Implement our own DestroyConfirm or propose a builtin action for Vagrant core
# TODO: Implement our own MessageWillNotDestroy
b3.use VagrantPlugins::ProviderVirtualBox::Action::MessageWillNotDestroy
end
end
@ -182,7 +182,6 @@ module Vagrant
class ClearForwardedPorts < BaseAction; end
class PrepareForwardedPortCollisionParams < BaseAction; end
class ClearSharedFolders < BaseAction; end
class HostName < BaseAction; end
class Customize < BaseAction; end
end
end

View file

@ -3,7 +3,6 @@ module Vagrant
module Action
class IsRunning < BaseAction
def call(env)
# Set the result to be true if the machine is created.
env[:result] = env[:machine].state.running?
# Call the next if we have one (but we shouldn't, since this