From baf6eee5016fac7004a7b8be6f78d4505f347aeb Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Thu, 22 Jun 2017 17:25:03 +0200 Subject: Adds network/cidr mapping into a new service property Makes it possible to resolve network subnets within a service template; the data is transported into a new property ServiceData wired into every service which hopefully is generic enough to be extended in the future and transport more data. Data can be consumed in service templates to set config values which need to know what is the subnet where a deamon operates (for example the Ceph Public vs Cluster network). Change-Id: I28e21c46f1ef609517175f7e7ee19e28d1c0cba2 --- network/external.yaml | 2 ++ network/external_v6.yaml | 2 ++ network/internal_api.yaml | 2 ++ network/internal_api_v6.yaml | 2 ++ network/management.yaml | 3 ++- network/management_v6.yaml | 2 ++ network/networks.j2.yaml | 20 ++++++++++++++++++++ network/storage.yaml | 2 ++ network/storage_mgmt.yaml | 2 ++ network/storage_mgmt_v6.yaml | 2 ++ network/storage_v6.yaml | 2 ++ network/tenant.yaml | 2 ++ network/tenant_v6.yaml | 2 ++ 13 files changed, 44 insertions(+), 1 deletion(-) (limited to 'network') diff --git a/network/external.yaml b/network/external.yaml index 5b1023d7..8dbe3e20 100644 --- a/network/external.yaml +++ b/network/external.yaml @@ -65,3 +65,5 @@ outputs: OS::stack_id: description: Neutron external network value: {get_resource: ExternalNetwork} + subnet_cidr: + value: {get_attr: ExternalSubnet, cidr} diff --git a/network/external_v6.yaml b/network/external_v6.yaml index 29930bbb..3266932a 100644 --- a/network/external_v6.yaml +++ b/network/external_v6.yaml @@ -72,3 +72,5 @@ outputs: OS::stack_id: description: Neutron external network value: {get_resource: ExternalNetwork} + subnet_cidr: + value: {get_attr: ExternalSubnet, cidr} diff --git a/network/internal_api.yaml b/network/internal_api.yaml index 554b900e..7ff0dafd 100644 --- a/network/internal_api.yaml +++ b/network/internal_api.yaml @@ -61,3 +61,5 @@ outputs: OS::stack_id: description: Neutron internal network value: {get_resource: InternalApiNetwork} + subnet_cidr: + value: {get_attr: InternalApiSubnet, cidr} diff --git a/network/internal_api_v6.yaml b/network/internal_api_v6.yaml index a089aa79..0688f138 100644 --- a/network/internal_api_v6.yaml +++ b/network/internal_api_v6.yaml @@ -68,3 +68,5 @@ outputs: OS::stack_id: description: Neutron internal network value: {get_resource: InternalApiNetwork} + subnet_cidr: + value: {get_attr: InternalApiSubnet, cidr} diff --git a/network/management.yaml b/network/management.yaml index 41ede5cd..f54794c3 100644 --- a/network/management.yaml +++ b/network/management.yaml @@ -66,4 +66,5 @@ outputs: OS::stack_id: description: Neutron management network value: {get_resource: ManagementNetwork} - + subnet_cidr: + value: {get_attr: ManagementSubnet, cidr} diff --git a/network/management_v6.yaml b/network/management_v6.yaml index e2527c42..bf715513 100644 --- a/network/management_v6.yaml +++ b/network/management_v6.yaml @@ -67,3 +67,5 @@ outputs: OS::stack_id: description: Neutron management network value: {get_resource: ManagementNetwork} + subnet_cidr: + value: {get_attr: ManagementSubnet, cidr} diff --git a/network/networks.j2.yaml b/network/networks.j2.yaml index f19e2c09..5aec597a 100644 --- a/network/networks.j2.yaml +++ b/network/networks.j2.yaml @@ -15,3 +15,23 @@ resources: NetworkExtraConfig: type: OS::TripleO::Network::ExtraConfig + + +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 + {%- for network in networks %} + {%- if network.name != 'InternalApi' %} + {{network.name_lower}}: + yaql: + data: {get_attr: [{{network.name}}Network, subnet_cidr]} + expression: str($.data).replace('null', 'disabled') + {%- else %} + {{network.name_lower}}: + yaql: + data: {get_attr: [InternalNetwork, subnet_cidr]} + expression: str($.data).replace('null', 'disabled') + {%- endif %} + {%- endfor %} diff --git a/network/storage.yaml b/network/storage.yaml index 5c68c4c7..00316c51 100644 --- a/network/storage.yaml +++ b/network/storage.yaml @@ -61,3 +61,5 @@ outputs: OS::stack_id: description: Neutron storage network value: {get_resource: StorageNetwork} + subnet_cidr: + value: {get_attr: StorageSubnet, cidr} diff --git a/network/storage_mgmt.yaml b/network/storage_mgmt.yaml index 23c5b4b7..bc4347c2 100644 --- a/network/storage_mgmt.yaml +++ b/network/storage_mgmt.yaml @@ -61,3 +61,5 @@ outputs: OS::stack_id: description: Neutron storage management network value: {get_resource: StorageMgmtNetwork} + subnet_cidr: + value: {get_attr: StorageMgmtSubnet, cidr} diff --git a/network/storage_mgmt_v6.yaml b/network/storage_mgmt_v6.yaml index ea60b5e7..0d6614f9 100644 --- a/network/storage_mgmt_v6.yaml +++ b/network/storage_mgmt_v6.yaml @@ -68,3 +68,5 @@ outputs: OS::stack_id: description: Neutron storage management network value: {get_resource: StorageMgmtNetwork} + subnet_cidr: + value: {get_attr: StorageMgmtSubnet, cidr} diff --git a/network/storage_v6.yaml b/network/storage_v6.yaml index 52bd42a4..bf796b2b 100644 --- a/network/storage_v6.yaml +++ b/network/storage_v6.yaml @@ -68,3 +68,5 @@ outputs: OS::stack_id: description: Neutron storage network value: {get_resource: StorageNetwork} + subnet_cidr: + value: {get_attr: StorageSubnet, cidr} diff --git a/network/tenant.yaml b/network/tenant.yaml index c50dca27..2104f0bd 100644 --- a/network/tenant.yaml +++ b/network/tenant.yaml @@ -61,3 +61,5 @@ outputs: OS::stack_id: description: Neutron tenant network value: {get_resource: TenantNetwork} + subnet_cidr: + value: {get_attr: TenantSubnet, cidr} diff --git a/network/tenant_v6.yaml b/network/tenant_v6.yaml index c77c2cbe..9993eec9 100644 --- a/network/tenant_v6.yaml +++ b/network/tenant_v6.yaml @@ -68,3 +68,5 @@ outputs: OS::stack_id: description: Neutron tenant network value: {get_resource: TenantNetwork} + subnet_cidr: + value: {get_attr: TenantSubnet, cidr} -- cgit 1.2.3-korg