mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-03 21:52:31 +09:00
F #7675: option to configure FQDN for remote_addr
So the resolver on the host will provide the IP address for the opennebula-gate service. This way, with DNS view or a line in /etc/hosts the tproxy service will pick the desired IP to connect to the opennebula-gate
This commit is contained in:
1 parent
bb6f6256be
commit
820c1545bf
2 files changed
+17
-2
No files matched your search
@@ -124,7 +124,9 @@
|
||||
# - :networks: [0, vnet1]
|
||||
#
|
||||
# The simplest example of an OneGate proxy config applied to all VNETs:
|
||||
# When a FQDN is configured for :remote_addr:, the host resolver will resolve
|
||||
# it to an IP.
|
||||
# :tproxy:
|
||||
# - :service_port: 5030
|
||||
# :remote_addr: 10.11.12.13 # HA VIP
|
||||
# :remote_addr: 10.11.12.13 # HA VIP or FQDN
|
||||
# :remote_port: 5030
|
||||
@@ -44,7 +44,20 @@ module VNMMAD
|
||||
&& (nets & nic.slice(:network, :network_id).values.map(&:to_s)).empty?
|
||||
|
||||
next if conf[:service_port].nil?
|
||||
next if conf[:remote_addr].nil? || conf[:remote_addr] !~ Resolv::IPv4::Regex
|
||||
next if conf[:remote_addr].nil? || conf[:remote_addr].to_s.strip.empty?
|
||||
|
||||
unless conf[:remote_addr] =~ Resolv::IPv4::Regex
|
||||
begin
|
||||
remote_ip = Resolv.getaddress(conf[:remote_addr])
|
||||
next unless remote_ip =~ Resolv::IPv4::Regex
|
||||
|
||||
OpenNebula::DriverLogger.log_info "Resolved remote_addr #{conf[:remote_addr]} to #{remote_ip}"
|
||||
conf[:remote_addr] = remote_ip
|
||||
rescue Resolv::ResolvError
|
||||
OpenNebula::DriverLogger.log_warning "Can't resolve remote_addr #{conf[:remote_addr]}. Skipping."
|
||||
next
|
||||
end
|
||||
end
|
||||
next if conf[:remote_port].nil?
|
||||
|
||||
opts = {
|
||||
|
||||
Reference in new issue
Block a user