Add config for container ssh IP
This commit is contained in:
parent
a84f8b59bf
commit
f71de429a1
2 changed files with 5 additions and 0 deletions
|
@ -21,6 +21,7 @@ module Vagrant
|
||||||
fetch_ip_tries = config.fetch_ip_tries
|
fetch_ip_tries = config.fetch_ip_tries
|
||||||
driver = env[:machine].provider.driver
|
driver = env[:machine].provider.driver
|
||||||
ip = ''
|
ip = ''
|
||||||
|
return config.ssh_ip_addr if not config.ssh_ip_addr.nil?
|
||||||
retryable(:on => LXC::Errors::ExecuteError, :tries => fetch_ip_tries, :sleep => 3) do
|
retryable(:on => LXC::Errors::ExecuteError, :tries => fetch_ip_tries, :sleep => 3) do
|
||||||
unless ip = get_container_ip_from_ip_addr(driver)
|
unless ip = get_container_ip_from_ip_addr(driver)
|
||||||
# retry
|
# retry
|
||||||
|
|
|
@ -24,6 +24,8 @@ module Vagrant
|
||||||
|
|
||||||
attr_accessor :fetch_ip_tries
|
attr_accessor :fetch_ip_tries
|
||||||
|
|
||||||
|
attr_accessor :ssh_ip_addr
|
||||||
|
|
||||||
# Whether the container needs to be privileged. Defaults to true (unprivileged containers
|
# Whether the container needs to be privileged. Defaults to true (unprivileged containers
|
||||||
# is a very new feature in vagrant-lxc). If false, will try creating an unprivileged
|
# is a very new feature in vagrant-lxc). If false, will try creating an unprivileged
|
||||||
# container. If it can't, will revert to the old "sudo wrapper" method to create a privileged
|
# container. If it can't, will revert to the old "sudo wrapper" method to create a privileged
|
||||||
|
@ -37,6 +39,7 @@ module Vagrant
|
||||||
@container_name = UNSET_VALUE
|
@container_name = UNSET_VALUE
|
||||||
@tmpfs_mount_size = UNSET_VALUE
|
@tmpfs_mount_size = UNSET_VALUE
|
||||||
@fetch_ip_tries = UNSET_VALUE
|
@fetch_ip_tries = UNSET_VALUE
|
||||||
|
@ssh_ip_addr = UNSET_VALUE
|
||||||
@privileged = UNSET_VALUE
|
@privileged = UNSET_VALUE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -66,6 +69,7 @@ module Vagrant
|
||||||
@existing_container_name = nil if @existing_container_name == UNSET_VALUE
|
@existing_container_name = nil if @existing_container_name == UNSET_VALUE
|
||||||
@tmpfs_mount_size = '2G' if @tmpfs_mount_size == UNSET_VALUE
|
@tmpfs_mount_size = '2G' if @tmpfs_mount_size == UNSET_VALUE
|
||||||
@fetch_ip_tries = 10 if @fetch_ip_tries == UNSET_VALUE
|
@fetch_ip_tries = 10 if @fetch_ip_tries == UNSET_VALUE
|
||||||
|
@ssh_ip_addr = nil if @ssh_ip_addr == UNSET_VALUE
|
||||||
@privileged = true if @privileged == UNSET_VALUE
|
@privileged = true if @privileged == UNSET_VALUE
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue