Skip to content

Commit

Permalink
added write IP address to generated file on hyperv #119
Browse files Browse the repository at this point in the history
  • Loading branch information
jadilet committed Sep 11, 2018
1 parent 2434660 commit 9594de7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/vagrant-subutai/packer/subutai_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ module SubutaiConfig
_DISK_SIZE
_DISK_PORT
_DISK_PATHES
_IP_HYPERV
].freeze

# Used for testing
Expand Down
13 changes: 13 additions & 0 deletions lib/vagrant-subutai/registration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,19 @@ def provision
end
end
end

# Write peer ip address to genereted file if provider Hyper-V
if SubutaiConfig.boolean?(:SUBUTAI_PEER) && SubutaiConfig.write? && SubutaiConfig.provider == :hyper_v
subutai_cli = Commands.new(ARGV, @machine.env)
ip = subutai_cli.info(Configs::VagrantCommand::ARG_IP_ADDR)

if ip.nil?
STDOUT.puts 'We can\'t detect your PeerOS ip address!'
exit
end

SubutaiConfig.put(:_IP_HYPERV, ip, true)
end
end

# This is the method called when destroying a machine that allows
Expand Down

0 comments on commit 9594de7

Please sign in to comment.