Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Make NetCidrMapValue contain list of cidrs in each net
Browse files Browse the repository at this point in the history
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
  • Loading branch information
hjensas committed Jan 6, 2019
1 parent 00cecfe commit 8665a0d
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 17 deletions.
8 changes: 7 additions & 1 deletion deployed-server/deployed-neutron-port.yaml
Expand Up @@ -12,7 +12,10 @@ description: "
fixed_ips:
- ip_address: 127.0.0.1
subnets:
- cidr: 127.0.0.0/24"
- cidr: 127.0.0.0/24
network:
tags:
- 127.0.0.0/24"

parameters:
name:
Expand All @@ -39,6 +42,9 @@ outputs:
subnets:
value:
{get_param: [DeployedServerPortMap, {get_param: name}, subnets]}
network:
value:
{get_param: [DeployedServerPortMap, {get_param: name}, network]}
name:
value: {get_param: name}
status:
Expand Down
1 change: 1 addition & 0 deletions deployment/memcached/memcached-container-puppet.yaml
Expand Up @@ -83,6 +83,7 @@ outputs:
monitoring_subscription: {get_param: MonitoringSubscriptionMemcached}
config_settings:
memcached_network:
# TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, MemcachedNetwork]}
str_replace:
template:
"%{hiera('$NETWORK_subnet')}"
Expand Down
1 change: 1 addition & 0 deletions deployment/snmp/snmp-baremetal-puppet.yaml
Expand Up @@ -67,6 +67,7 @@ outputs:
snmp::agentaddress: {get_param: SnmpdBindHost}
snmp::snmpd_options: {get_param: SnmpdOptions}
snmpd_network:
# TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, SnmpdNetwork]}
str_replace:
template: "%{hiera('$NETWORK_subnet')}"
params:
Expand Down
15 changes: 12 additions & 3 deletions docker/services/ceph-ansible/ceph-base.yaml
Expand Up @@ -231,9 +231,18 @@ resources:
ceph_docker_image: {get_attr: [DockerImageUrlParts, value, image]}
ceph_docker_image_tag: {get_attr: [DockerImageUrlParts, value, image_tag]}
containerized_deployment: true
public_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]}
monitor_address_block: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]}
cluster_network: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]}
public_network:
list_join:
- ','
- get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]
monitor_address_block:
list_join:
- ','
- get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephMonNetwork]}]
cluster_network:
list_join:
- ','
- get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephClusterNetwork]}]
user_config: true
ceph_stable: true
ceph_origin: distro
Expand Down
5 changes: 4 additions & 1 deletion docker/services/ceph-ansible/ceph-rgw.yaml
Expand Up @@ -58,7 +58,10 @@ resources:
vars:
radosgw_keystone: true
radosgw_keystone_ssl: false
radosgw_address_block: {get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephRgwNetwork]}]}
radosgw_address_block:
list_join:
- ','
- get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, CephRgwNetwork]}]
radosgw_civetweb_port: {get_param: [EndpointMap, CephRgwInternal, port]}

outputs:
Expand Down
5 changes: 1 addition & 4 deletions network/network.j2
Expand Up @@ -195,10 +195,7 @@ outputs:
OS::stack_id:
description: {{network.name_lower}} network
value: {get_resource: {{network.name}}Network}
subnet_cidr:
description: The {{network.name}} networks base subnet in CIDR notation.
value: {get_attr: [{{network.name}}Subnet, cidr]}
subnet_cidrs:
network_cidrs:
description: List of {{network.name}} network's subnets in CIDR notation.
value:
list_concat:
Expand Down
15 changes: 11 additions & 4 deletions network/networks.j2.yaml
Expand Up @@ -2,6 +2,11 @@ heat_template_version: rocky

description: Create networks to split out Overcloud traffic

parameters:
CtlplaneNetworkCidrs:
type: json
description: Cidrs for the ctlplane network.

resources:
{%- for network in networks %}
{%- set network_name = network.compat_name|default(network.name) %}
Expand All @@ -16,12 +21,14 @@ resources:
outputs:
net_cidr_map:
value:
# NOTE(gfidente): we need to replace the null value with a
# string to work around https://bugs.launchpad.net/heat/+bug/1700025
# NOTE(hjensas): If a network does not have any network_cidrs, fall back
# to the ctlplane (provisioning) network.
{%- for network in networks %}
{%- set network_name = network.compat_name|default(network.name) %}
{{network.name_lower}}:
yaql:
data: {get_attr: [{{network_name}}Network, subnet_cidr]}
expression: str($.data).replace('null', 'disabled')
data:
network_cidrs: {get_attr: [{{network_name}}Network, network_cidrs]}
ctlplane_cidrs: {get_param: CtlplaneNetworkCidrs}
expression: switch(not isList($.data.network_cidrs) => $.data.ctlplane_cidrs, $.data.network_cidrs => $.data.network_cidrs)
{%- endfor %}
10 changes: 6 additions & 4 deletions overcloud.j2.yaml
Expand Up @@ -350,11 +350,11 @@ resources:
map_replace:
- map_merge:
- {get_attr: [Networks, net_cidr_map]}
- ctlplane: {get_attr: [ControlVirtualIP, subnets, 0, cidr]}
# NOTE(hjensas): When ctlplane network and subnets are created by the
# undercloud installer, the subnet cidrs are added as tags.
- ctlplane: {get_attr: [ControlVirtualIP, network, tags]}
- keys:
ctlplane: {get_param: NeutronControlPlaneID}
values:
disabled: {get_attr: [ControlVirtualIP, subnets, 0, cidr]}

ServiceNetMap:
type: OS::TripleO::ServiceNetMap
Expand Down Expand Up @@ -811,9 +811,11 @@ resources:
# creates the network architecture
Networks:
type: OS::TripleO::Network
properties:
CtlplaneNetworkCidrs: {get_attr: [ControlVirtualIP, network, tags]}

ControlVirtualIP:
depends_on: [Networks, ServiceNetMap]
depends_on: ServiceNetMap
type: OS::TripleO::Network::Ports::ControlPlaneVipPort
properties:
name: control_virtual_ip
Expand Down
1 change: 1 addition & 0 deletions puppet/services/apache.j2.yaml
Expand Up @@ -91,6 +91,7 @@ outputs:
apache::server_signature: 'Off'
apache::server_tokens: 'Prod'
apache_remote_proxy_ips_network:
# TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, ApacheNetwork]}
str_replace:
template:
"%{hiera('$NETWORK_subnet')}"
Expand Down
1 change: 1 addition & 0 deletions puppet/services/designate-worker.yaml
Expand Up @@ -94,6 +94,7 @@ outputs:
params:
$NETWORK: {get_param: [ServiceNetMap, DesignateApiNetwork]}
tripleo::profile::base::designate::rndc_allowed_addresses:
# TODO(hjensas): Replace with get_param: [ServiceData, net_cidr_map, {get_param: [ServiceNetMap, DesignateApiNetwork]}
- str_replace:
template:
"%{hiera('$NETWORK_subnet')}"
Expand Down
@@ -0,0 +1,29 @@
---
upgrade:
- |
Tags are now used on the ``ctlplane`` network to store the list of cidrs
associated with the subnets on the ``ctlplane`` network. Users of
Deployed Server (pre-provisioned servers) need to update the port map
(``DeployedServerPortMap``) to include the required data. For example::
parameter_defaults:
DeployedServerPortMap:
controller0-ctlplane:
fixed_ips:
- ip_address: 192.168.24.9
subnets:
- cidr: 192.168.24.0/24
network:
tags:
- 192.168.24.0/24
- 192.168.25.0/24
compute0-ctlplane:
fixed_ips:
- ip_address: 192.168.25.8
subnets:
- cidr: 192.168.25.0/24
network:
tags:
- 192.168.24.0/24
- 192.168.25.0/24

0 comments on commit 8665a0d

Please sign in to comment.