From 055133078dbbd838f54cb65b5e4b8d9334df171c Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Sun, 30 Oct 2022 00:26:45 +0900 Subject: [PATCH] Standalone: Generate port map in a new format The DeployedServerPortMap parameter was already deprecated[1] in favor of the new NodePortMap, ControlPlaneVipData and VipPortMap. This change ensures the deployment command use the new parameters. Note that the old parameter is still kept until the environment file is updated to use the new deployed-ports.yaml template. [1] 26be3179905c7751812aa10a0af9f56e58e7ef08 Change-Id: Ifd7bfe266be39b4a3643e5fcf1fd506d777448db --- tripleoclient/v1/tripleo_deploy.py | 33 ++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/tripleoclient/v1/tripleo_deploy.py b/tripleoclient/v1/tripleo_deploy.py index 142c80726..9d9d75901 100644 --- a/tripleoclient/v1/tripleo_deploy.py +++ b/tripleoclient/v1/tripleo_deploy.py @@ -316,6 +316,11 @@ class Deploy(command.Command): } return data + def _ip_for_uri(self, ip_addr, ip_nw): + if ip_nw.version == 6: + return '[%s]' % ip_addr + return ip_addr + def _generate_portmap_parameters(self, ip_addr, ip_nw, ctlplane_vip_addr, public_vip_addr, stack_name='Undercloud', role_name='Undercloud'): @@ -357,6 +362,34 @@ class Deploy(command.Command): 'ip_version': ip_nw.version}], 'network': {'tags': [str(ip_nw.cidr)]} } + }, + 'NodePortMap': { + hostname: { + 'ctlplane': { + 'ip_address': ip_addr, + 'ip_address_uri': self._ip_for_uri(ip_addr, ip_nw), + 'ip_subnet': '%s/%s' % (ip_addr, ip_nw.prefixlen) + } + } + }, + 'ControlPlaneVipData': { + 'fixed_ips': [ + {'ip_address': ctlplane_vip_addr} + ], + 'name': 'control_virtual_ip', + 'network': { + 'tags': ['%s/%s' % (ctlplane_vip_addr, ip_nw.prefixlen)] + }, + 'subnets': [ + {'ip_version': ip_nw.version} + ] + }, + 'VipPortMap': { + 'external': { + 'ip_address': public_vip_addr, + 'ip_address_uri': self._ip_for_uri(public_vip_addr, ip_nw), + 'ip_subnet': '%s/%s' % (public_vip_addr, ip_nw.prefixlen) + } } } return data