Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions src/plugins/gr-he-ansiblesetup/core/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@


import gettext
import netaddr
import re
import uuid

Expand Down Expand Up @@ -434,6 +435,25 @@ def _closeup(self):
]
}

# If a static CIDR is provided for the Hosted Engine VM,
# then we force connection to the host with same IP version
# Otherwise we end up in a situation where the IPv6 only
# HE VM tries to connect to the host with an IPv4 address
if self.environment[ohostedcons.CloudInit.VM_STATIC_CIDR]:
ip = netaddr.IPNetwork(
self.environment[ohostedcons.CloudInit.VM_STATIC_CIDR]
)
if ip.version == 6:
if self.environment[ohostedcons.NetworkEnv.FORCE_IPV4]:
raise RuntimeError(
_('Cannot force IPv4 when HE static IP is IPv6'))
bootstrap_vars['he_force_ip6'] = True
else:
if self.environment[ohostedcons.NetworkEnv.FORCE_IPV6]:
raise RuntimeError(
_('Cannot force IPv6 when HE static IP is IPv4'))
bootstrap_vars['he_force_ip4'] = True

if self.environment[
ohostedcons.CoreEnv.RENEW_PKI_ON_RESTORE
] is not None:
Expand Down