Browse Source

Merge "Add SERVICE_bootstrap_node_ip values to allNodesConfig"

tags/10.3.0
Zuul 6 months ago
parent
commit
2485978bee

+ 23
- 0
network/ports/net_ip_list_map.j2.yaml View File

@@ -164,3 +164,26 @@ outputs:
164 164
                   SERVICE_short_bootstrap_node_name: {get_param: ServiceHostnameList}
165 165
                 for_each:
166 166
                     SERVICE: {get_attr: [EnabledServicesValue, value]}
167
+  service_bootstrap_ips:
168
+    description: >
169
+      Map of enabled services to a list of their IP addresses
170
+      Used for bootstrap purposes
171
+    value:
172
+      yaql:
173
+        # This filters any entries where the value hasn't been substituted for
174
+        # a list, e.g it's still $service_network.  This happens when there is
175
+        # no network defined for the service in the ServiceNetMap, which is OK
176
+        # as not all services have to be bound to a network, so we filter them
177
+        expression: dict($.data.map.items().where(not isString($[1])))
178
+        data:
179
+          map:
180
+            map_replace:
181
+              - map_replace:
182
+                  - map_merge:
183
+                      repeat:
184
+                        template:
185
+                          SERVICE_bootstrap_node_ip: SERVICE_network
186
+                        for_each:
187
+                          SERVICE: {get_attr: [EnabledServicesValue, value]}
188
+                  - values: {get_param: ServiceNetMap}
189
+              - values: {get_attr: [NetIpMapValue, value]}

+ 8
- 4
overcloud.j2.yaml View File

@@ -513,10 +513,6 @@ resources:
513 513
           yaql:
514 514
             expression: coalesce($.data, []).first(null)
515 515
             data: {get_attr: [{{role.name}}, hostname]}
516
-        bootstrap_nodeid_ip:
517
-          yaql:
518
-            expression: coalesce($.data, []).first(null)
519
-            data: {get_attr: [{{role.name}}, ip_address]}
520 516
 
521 517
   {{role.name}}AllNodesValidationDeployment:
522 518
     type: OS::Heat::StructuredDeployments
@@ -735,6 +731,14 @@ resources:
735 731
             l:
736 732
 {% for role in roles %}
737 733
               - {get_attr: [{{role.name}}IpListMap, short_service_bootstrap_hostnames]}
734
+{% endfor %}
735
+      service_bootstrap_node_ip:
736
+        yaql:
737
+          expression: dict($.data.l.where($ != null).selectMany($.items()).groupBy($[0], $[1]).select([$[0], $[1].flatten().first()]))
738
+          data:
739
+            l:
740
+{% for role in roles %}
741
+              - {get_attr: [{{role.name}}IpListMap, service_bootstrap_ips]}
738 742
 {% endfor %}
739 743
       NetVipMap: {get_attr: [VipMap, net_ip_map]}
740 744
       RedisVirtualIP: {get_attr: [RedisVirtualIP, ip_address]}

+ 3
- 1
puppet/all-nodes-config.j2.yaml View File

@@ -20,6 +20,8 @@ parameters:
20 20
     type: json
21 21
   short_service_bootstrap_node:
22 22
     type: json
23
+  service_bootstrap_node_ip:
24
+    type: json
23 25
   controller_names:
24 26
     type: comma_delimited_list
25 27
   cellv2_discovery_hosts:
@@ -131,6 +133,7 @@ resources:
131 133
                 - {get_param: service_node_names}
132 134
                 - {get_param: short_service_node_names}
133 135
                 - {get_param: short_service_bootstrap_node}
136
+                - {get_param: service_bootstrap_node_ip}
134 137
                 - controller_node_ips:
135 138
                     list_join:
136 139
                     - ','
@@ -156,7 +159,6 @@ resources:
156 159
         datafiles:
157 160
           bootstrap_node:
158 161
             bootstrap_nodeid: {get_input: bootstrap_nodeid}
159
-            bootstrap_nodeid_ip: {get_input: bootstrap_nodeid_ip}
160 162
           all_nodes: {get_attr: [allNodesConfigValue, value]}
161 163
           vip_data:
162 164
             map_merge:

+ 1
- 1
puppet/services/database/redis-base.yaml View File

@@ -81,7 +81,7 @@ outputs:
81 81
                 $NETWORK: {get_param: [ServiceNetMap, RedisNetwork]}
82 82
         redis::port: 6379
83 83
         redis::sentinel::master_name: "%{hiera('redis_short_bootstrap_node_name')}"
84
-        redis::sentinel::redis_host: "%{hiera('bootstrap_nodeid_ip')}"
84
+        redis::sentinel::redis_host: "%{hiera('redis_bootstrap_node_ip')}"
85 85
         redis::sentinel::notification_script: '/usr/local/bin/redis-notifications.sh'
86 86
         redis::sentinel::sentinel_bind:
87 87
           if:

+ 7
- 0
releasenotes/notes/remove_bootstrap_nodeid_ip-d97ec1da4f73599c.yaml View File

@@ -0,0 +1,7 @@
1
+---
2
+upgrade:
3
+  - |
4
+    The hiera bootstrap_nodeid_ip key has been replaced with per-service
5
+    SERVICE_bootstrap_node_ip where SERVICE is the service_name from the
6
+    composable service templates.  If any out-of-tree services use this
7
+    key they will need to adjust to the new interface on upgrade.

Loading…
Cancel
Save