Browse Source

Merge "Always specify interface for vips" into stable/stein

changes/43/681243/1
Zuul 1 week ago
parent
commit
885c409c4c
1 changed files with 30 additions and 7 deletions
  1. 30
    7
      tripleoclient/v1/undercloud_config.py

+ 30
- 7
tripleoclient/v1/undercloud_config.py View File

@@ -574,11 +574,6 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
574 574
         env_data.update(
575 575
             _get_public_tls_parameters(
576 576
                 CONF.get('undercloud_service_certificate')))
577
-        deploy_args += [
578
-            '-e', os.path.join(tht_templates, 'environments/services/'
579
-                               'undercloud-haproxy.yaml'),
580
-            '-e', os.path.join(tht_templates, 'environments/services/'
581
-                               'undercloud-keepalived.yaml')]
582 577
     elif CONF.get('generate_service_certificate'):
583 578
         deploy_args += ['-e', os.path.join(
584 579
             tht_templates,
@@ -594,7 +589,7 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
594 589
             CONF.get('undercloud_public_host'), tht_templates)
595 590
 
596 591
         public_host = utils.get_single_ip(CONF.get('undercloud_public_host'))
597
-        netaddr.IPAddress(public_host)
592
+        public_ip = netaddr.IPAddress(public_host)
598 593
         deploy_args += ['--public-virtual-ip', public_host]
599 594
 
600 595
         # To make sure the resolved host is set to the right IP in /etc/hosts
@@ -603,9 +598,37 @@ def prepare_undercloud_deploy(upgrade=False, no_validations=False,
603 598
             env_data['ExtraHostFileEntries'] = extra_host
604 599
 
605 600
         admin_host = utils.get_single_ip(CONF.get('undercloud_admin_host'))
606
-        netaddr.IPAddress(admin_host)
601
+        admin_ip = netaddr.IPAddress(admin_host)
607 602
         deploy_args += ['--control-virtual-ip', admin_host]
608 603
 
604
+        local_net = netaddr.IPNetwork(CONF.get('local_ip'))
605
+        if CONF.get('net_config_override', None):
606
+            if (admin_ip not in local_net.cidr):
607
+                LOG.warning('You may need to specify a custom '
608
+                            'ControlVirtualInterface in a custom env file to '
609
+                            'correctly assign the ip address to an interface '
610
+                            'for undercloud_admin_host. By default it will be '
611
+                            'set to br-ctlplane.')
612
+            if (public_ip not in local_net.cidr):
613
+                LOG.warning('You may need to specify a custom '
614
+                            'PublicVirtualInterface in a custom env file to '
615
+                            'correctly assign the ip address to an interface '
616
+                            'for undercloud_public_host. By default it will be'
617
+                            ' set to br-ctlplane.')
618
+        else:
619
+            if (admin_ip not in local_net.cidr or
620
+                    public_ip not in local_net.cidr):
621
+                LOG.warning('undercloud_admin_host or undercloud_public_host '
622
+                            'is not in the same cidr as local_ip.')
623
+
624
+        # Define the *VirtualInterfaces for keepalived. These are used when
625
+        # configuring the undercloud_*_host addresses. If these adddesses are
626
+        # not in the default cidr for the ctlplane, it will not be defined
627
+        # and leads to general sadness during the deployment. Our default
628
+        # net_config uses br-ctlplane. See rhbz#1737150
629
+        env_data['ControlVirtualInterface'] = 'br-ctlplane'
630
+        env_data['PublicVirtualInterface'] = 'br-ctlplane'
631
+
609 632
         deploy_args += [
610 633
             '-e', endpoint_environment,
611 634
             '-e', os.path.join(

Loading…
Cancel
Save