summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHarald Jensås <hjensas@redhat.com>2018-10-25 20:07:00 +0200
committerHarald Jensås <hjensas@redhat.com>2019-01-06 18:20:27 +0100
commit8665a0d97b13266c5a926e7062554ed8af185a64 (patch)
tree78b670f90a5d473dad9408054db425c389e09bf5
parent00cecfe2f3268ae12842f69758455968782a3272 (diff)
Make NetCidrMapValue contain list of cidrs in each net
Prior to routed networks we only had one subnet per network. With routed networks each network can have multiple subnets. The NetCidrMapValue should contain a list storing the cidr of each subnet for each network. Ceph: list_join is used to make a comma separated list of cidrs for public_network, monitor_address_block, cluster_network and radosgw_address_block. Partial: blueprint tripleo-routed-networks-templates Depends-On: Ia8e219b30d4f8b199b882e95fe2834252a92c15a Depends-On: I1ace0a02e6aa2610559fee0d8576e6f1bc98d699 Change-Id: I68e064d23ec5d43f59146d974cae604d2c5fdb52
Notes
Notes (review): Code-Review+2: Bob Fournier <bfournie@redhat.com> Verified+1: RDO Third Party CI <dmsimard+rdothirdparty@redhat.com> Code-Review+1: Bogdan Dobrelya <bdobreli@redhat.com> Code-Review+2: Alex Schultz <aschultz@redhat.com> Workflow+1: Alex Schultz <aschultz@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Wed, 09 Jan 2019 20:02:14 +0000 Reviewed-on: https://review.openstack.org/613459 Project: openstack/tripleo-heat-templates Branch: refs/heads/master
-rw-r--r--deployed-server/deployed-neutron-port.yaml8
-rw-r--r--deployment/memcached/memcached-container-puppet.yaml1
-rw-r--r--deployment/snmp/snmp-baremetal-puppet.yaml1
-rw-r--r--docker/services/ceph-ansible/ceph-base.yaml15
-rw-r--r--docker/services/ceph-ansible/ceph-rgw.yaml5
-rw-r--r--network/network.j25
-rw-r--r--network/networks.j2.yaml15
-rw-r--r--overcloud.j2.yaml10
-rw-r--r--puppet/services/apache.j2.yaml1
-rw-r--r--puppet/services/designate-worker.yaml1
-rw-r--r--releasenotes/notes/make-NetCidrMapValue-contain-lists-of-cidrs-19bc98dc9bc6b819.yaml29
11 files changed, 74 insertions, 17 deletions
diff --git a/deployed-server/deployed-neutron-port.yaml b/deployed-server/deployed-neutron-port.yaml
index c983d39..f490985 100644
--- a/deployed-server/deployed-neutron-port.yaml
+++ b/deployed-server/deployed-neutron-port.yaml
@@ -12,7 +12,10 @@ description: "
12 fixed_ips: 12 fixed_ips:
13 - ip_address: 127.0.0.1 13 - ip_address: 127.0.0.1
14 subnets: 14 subnets:
15 - cidr: 127.0.0.0/24" 15 - cidr: 127.0.0.0/24
16 network:
17 tags:
18 - 127.0.0.0/24"
16 19
17parameters: 20parameters:
18 name: 21 name:
@@ -39,6 +42,9 @@ outputs:
39 subnets: 42 subnets:
40 value: 43 value:
41 {get_param: [DeployedServerPortMap, {get_param: name}, subnets]} 44 {get_param: [DeployedServerPortMap, {get_param: name}, subnets]}
45 network:
46 value:
47 {get_param: [DeployedServerPortMap, {get_param: name}, network]}
42 name: 48 name:
43 value: {get_param: name} 49 value: {get_param: name}
44 status: 50 status:
diff --git a/deployment/memcached/memcached-container-puppet.yaml b/deployment/memcached/memcached-container-puppet.yaml
index b8c60e1..ee6578d 100644
--- a/deployment/memcached/memcached-container-puppet.yaml
+++ b/deployment/memcached/memcached-container-puppet.yaml
@@ -83,6 +83,7 @@ outputs:
83 monitoring_subscription: {get_param: MonitoringSubscriptionMemcached} 83 monitoring_subscription: {get_param: MonitoringSubscriptionMemcached}
84 config_settings: 84 config_settings:
85 memcached_network: 85 memcached_network:
86 # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, MemcachedNetwork]}
86 str_replace: 87 str_replace:
87 template: 88 template:
88 "%{hiera('$NETWORK_subnet')}" 89 "%{hiera('$NETWORK_subnet')}"
diff --git a/deployment/snmp/snmp-baremetal-puppet.yaml b/deployment/snmp/snmp-baremetal-puppet.yaml
index 369ea5c..2869f07 100644
--- a/deployment/snmp/snmp-baremetal-puppet.yaml
+++ b/deployment/snmp/snmp-baremetal-puppet.yaml
@@ -67,6 +67,7 @@ outputs:
67 snmp::agentaddress: {get_param: SnmpdBindHost} 67 snmp::agentaddress: {get_param: SnmpdBindHost}
68 snmp::snmpd_options: {get_param: SnmpdOptions} 68 snmp::snmpd_options: {get_param: SnmpdOptions}
69 snmpd_network: 69 snmpd_network:
70 # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, SnmpdNetwork]}
70 str_replace: 71 str_replace:
71 template: "%{hiera('$NETWORK_subnet')}" 72 template: "%{hiera('$NETWORK_subnet')}"
72 params: 73 params:
diff --git a/docker/services/ceph-ansible/ceph-base.yaml b/docker/services/ceph-ansible/ceph-base.yaml
index fdfc7f5..401ed2a 100644
--- a/docker/services/ceph-ansible/ceph-base.yaml
+++ b/docker/services/ceph-ansible/ceph-base.yaml
@@ -231,9 +231,18 @@ resources:
231 ceph_docker_image: {get_attr: [DockerImageUrlParts, value, image]} 231 ceph_docker_image: {get_attr: [DockerImageUrlParts, value, image]}
232 ceph_docker_image_tag: {get_attr: [DockerImageUrlParts, value, image_tag]} 232 ceph_docker_image_tag: {get_attr: [DockerImageUrlParts, value, image_tag]}
233 containerized_deployment: true 233 containerized_deployment: true
234 public_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]} 234 public_network:
235 monitor_address_block: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]} 235 list_join:
236 cluster_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]} 236 - ','
237 - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]
238 monitor_address_block:
239 list_join:
240 - ','
241 - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]
242 cluster_network:
243 list_join:
244 - ','
245 - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]
237 user_config: true 246 user_config: true
238 ceph_stable: true 247 ceph_stable: true
239 ceph_origin: distro 248 ceph_origin: distro
diff --git a/docker/services/ceph-ansible/ceph-rgw.yaml b/docker/services/ceph-ansible/ceph-rgw.yaml
index 4645050..5fbdba5 100644
--- a/docker/services/ceph-ansible/ceph-rgw.yaml
+++ b/docker/services/ceph-ansible/ceph-rgw.yaml
@@ -58,7 +58,10 @@ resources:
58 vars: 58 vars:
59 radosgw_keystone: true 59 radosgw_keystone: true
60 radosgw_keystone_ssl: false 60 radosgw_keystone_ssl: false
61 radosgw_address_block: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephRgwNetwork]}]} 61 radosgw_address_block:
62 list_join:
63 - ','
64 - get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephRgwNetwork]}]
62 radosgw_civetweb_port: {get_param: [EndpointMap, CephRgwInternal, port]} 65 radosgw_civetweb_port: {get_param: [EndpointMap, CephRgwInternal, port]}
63 66
64outputs: 67outputs:
diff --git a/network/network.j2 b/network/network.j2
index b318cdf..92c3031 100644
--- a/network/network.j2
+++ b/network/network.j2
@@ -195,10 +195,7 @@ outputs:
195 OS::stack_id: 195 OS::stack_id:
196 description: {{network.name_lower}} network 196 description: {{network.name_lower}} network
197 value: {get_resource: {{network.name}}Network} 197 value: {get_resource: {{network.name}}Network}
198 subnet_cidr: 198 network_cidrs:
199 description: The {{network.name}} networks base subnet in CIDR notation.
200 value: {get_attr: [{{network.name}}Subnet, cidr]}
201 subnet_cidrs:
202 description: List of {{network.name}} network's subnets in CIDR notation. 199 description: List of {{network.name}} network's subnets in CIDR notation.
203 value: 200 value:
204 list_concat: 201 list_concat:
diff --git a/network/networks.j2.yaml b/network/networks.j2.yaml
index 615f93b..e398238 100644
--- a/network/networks.j2.yaml
+++ b/network/networks.j2.yaml
@@ -2,6 +2,11 @@ heat_template_version: rocky
2 2
3description: Create networks to split out Overcloud traffic 3description: Create networks to split out Overcloud traffic
4 4
5parameters:
6 CtlplaneNetworkCidrs:
7 type: json
8 description: Cidrs for the ctlplane network.
9
5resources: 10resources:
6 {%- for network in networks %} 11 {%- for network in networks %}
7 {%- set network_name = network.compat_name|default(network.name) %} 12 {%- set network_name = network.compat_name|default(network.name) %}
@@ -16,12 +21,14 @@ resources:
16outputs: 21outputs:
17 net_cidr_map: 22 net_cidr_map:
18 value: 23 value:
19 # NOTE(gfidente): we need to replace the null value with a 24 # NOTE(hjensas): If a network does not have any network_cidrs, fall back
20 # string to work around https://bugs.launchpad.net/heat/+bug/1700025 25 # to the ctlplane (provisioning) network.
21 {%- for network in networks %} 26 {%- for network in networks %}
22 {%- set network_name = network.compat_name|default(network.name) %} 27 {%- set network_name = network.compat_name|default(network.name) %}
23 {{network.name_lower}}: 28 {{network.name_lower}}:
24 yaql: 29 yaql:
25 data: {get_attr: [{{network_name}}Network, subnet_cidr]} 30 data:
26 expression: str($.data).replace('null', 'disabled') 31 network_cidrs: {get_attr: [{{network_name}}Network, network_cidrs]}
32 ctlplane_cidrs: {get_param: CtlplaneNetworkCidrs}
33 expression: switch(not isList($.data.network_cidrs) => $.data.ctlplane_cidrs, $.data.network_cidrs => $.data.network_cidrs)
27 {%- endfor %} 34 {%- endfor %}
diff --git a/overcloud.j2.yaml b/overcloud.j2.yaml
index da18dfe..3d422ed 100644
--- a/overcloud.j2.yaml
+++ b/overcloud.j2.yaml
@@ -350,11 +350,11 @@ resources:
350 map_replace: 350 map_replace:
351 - map_merge: 351 - map_merge:
352 - {get_attr: [Networks, net_cidr_map]} 352 - {get_attr: [Networks, net_cidr_map]}
353 - ctlplane: {get_attr: [ControlVirtualIP, subnets, 0, cidr]} 353 # NOTE(hjensas): When ctlplane network and subnets are created by the
354 # undercloud installer, the subnet cidrs are added as tags.
355 - ctlplane: {get_attr: [ControlVirtualIP, network, tags]}
354 - keys: 356 - keys:
355 ctlplane: {get_param: NeutronControlPlaneID} 357 ctlplane: {get_param: NeutronControlPlaneID}
356 values:
357 disabled: {get_attr: [ControlVirtualIP, subnets, 0, cidr]}
358 358
359 ServiceNetMap: 359 ServiceNetMap:
360 type: OS::TripleO::ServiceNetMap 360 type: OS::TripleO::ServiceNetMap
@@ -811,9 +811,11 @@ resources:
811 # creates the network architecture 811 # creates the network architecture
812 Networks: 812 Networks:
813 type: OS::TripleO::Network 813 type: OS::TripleO::Network
814 properties:
815 CtlplaneNetworkCidrs: {get_attr: [ControlVirtualIP, network, tags]}
814 816
815 ControlVirtualIP: 817 ControlVirtualIP:
816 depends_on: [Networks, ServiceNetMap] 818 depends_on: ServiceNetMap
817 type: OS::TripleO::Network::Ports::ControlPlaneVipPort 819 type: OS::TripleO::Network::Ports::ControlPlaneVipPort
818 properties: 820 properties:
819 name: control_virtual_ip 821 name: control_virtual_ip
diff --git a/puppet/services/apache.j2.yaml b/puppet/services/apache.j2.yaml
index cec5790..fbdf3d3 100644
--- a/puppet/services/apache.j2.yaml
+++ b/puppet/services/apache.j2.yaml
@@ -91,6 +91,7 @@ outputs:
91 apache::server_signature: 'Off' 91 apache::server_signature: 'Off'
92 apache::server_tokens: 'Prod' 92 apache::server_tokens: 'Prod'
93 apache_remote_proxy_ips_network: 93 apache_remote_proxy_ips_network:
94 # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, ApacheNetwork]}
94 str_replace: 95 str_replace:
95 template: 96 template:
96 "%{hiera('$NETWORK_subnet')}" 97 "%{hiera('$NETWORK_subnet')}"
diff --git a/puppet/services/designate-worker.yaml b/puppet/services/designate-worker.yaml
index 446882d..786936b 100644
--- a/puppet/services/designate-worker.yaml
+++ b/puppet/services/designate-worker.yaml
@@ -94,6 +94,7 @@ outputs:
94 params: 94 params:
95 $NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]} 95 $NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]}
96 tripleo::profile::base::designate::rndc_allowed_addresses: 96 tripleo::profile::base::designate::rndc_allowed_addresses:
97 # TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, DesignateApiNetwork]}
97 - str_replace: 98 - str_replace:
98 template: 99 template:
99 "%{hiera('$NETWORK_subnet')}" 100 "%{hiera('$NETWORK_subnet')}"
diff --git a/releasenotes/notes/make-NetCidrMapValue-contain-lists-of-cidrs-19bc98dc9bc6b819.yaml b/releasenotes/notes/make-NetCidrMapValue-contain-lists-of-cidrs-19bc98dc9bc6b819.yaml
new file mode 100644
index 0000000..b98b389
--- /dev/null
+++ b/releasenotes/notes/make-NetCidrMapValue-contain-lists-of-cidrs-19bc98dc9bc6b819.yaml
@@ -0,0 +1,29 @@
1---
2upgrade:
3 - |
4 Tags are now used on the ``ctlplane`` network to store the list of cidrs
5 associated with the subnets on the ``ctlplane`` network. Users of
6 Deployed Server (pre-provisioned servers) need to update the port map
7 (``DeployedServerPortMap``) to include the required data. For example::
8
9 parameter_defaults:
10 DeployedServerPortMap:
11 controller0-ctlplane:
12 fixed_ips:
13 - ip_address: 192.168.24.9
14 subnets:
15 - cidr: 192.168.24.0/24
16 network:
17 tags:
18 - 192.168.24.0/24
19 - 192.168.25.0/24
20 compute0-ctlplane:
21 fixed_ips:
22 - ip_address: 192.168.25.8
23 subnets:
24 - cidr: 192.168.25.0/24
25 network:
26 tags:
27 - 192.168.24.0/24
28 - 192.168.25.0/24
29