diff --git a/templates/baremetal-ports-all-port-security.yaml b/templates/baremetal-ports-all-port-security.yaml index 66c29d3..3ea7cef 100644 --- a/templates/baremetal-ports-all-port-security.yaml +++ b/templates/baremetal-ports-all-port-security.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json suffix: type: string @@ -46,7 +41,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} port_security_enabled: False internal_port: @@ -106,7 +101,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} port_security_enabled: False outputs: diff --git a/templates/baremetal-ports-all.yaml b/templates/baremetal-ports-all.yaml index 7dff06c..5f9736e 100644 --- a/templates/baremetal-ports-all.yaml +++ b/templates/baremetal-ports-all.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json suffix: type: string @@ -46,7 +41,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} internal_port: type: OS::Neutron::Port @@ -101,7 +96,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} outputs: ports: diff --git a/templates/baremetal-ports-default-port-security.yaml b/templates/baremetal-ports-default-port-security.yaml index 2b114c7..c9d19a0 100644 --- a/templates/baremetal-ports-default-port-security.yaml +++ b/templates/baremetal-ports-default-port-security.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json suffix: type: string @@ -26,7 +21,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} port_security_enabled: False outputs: diff --git a/templates/baremetal-ports-default.yaml b/templates/baremetal-ports-default.yaml index fd6ee0f..3e7fbc7 100644 --- a/templates/baremetal-ports-default.yaml +++ b/templates/baremetal-ports-default.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json suffix: type: string @@ -26,7 +21,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} outputs: ports: diff --git a/templates/baremetal-ports-extra-node-fip-port-security.yaml b/templates/baremetal-ports-extra-node-fip-port-security.yaml index 0db18b9..41672f4 100644 --- a/templates/baremetal-ports-extra-node-fip-port-security.yaml +++ b/templates/baremetal-ports-extra-node-fip-port-security.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json private_net: type: string @@ -62,7 +57,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} port_security_enabled: False public_port: @@ -74,7 +69,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} port_security_enabled: False extra_node_fip: diff --git a/templates/baremetal-ports-extra-node-port-security.yaml b/templates/baremetal-ports-extra-node-port-security.yaml index b91394d..151fdfc 100644 --- a/templates/baremetal-ports-extra-node-port-security.yaml +++ b/templates/baremetal-ports-extra-node-port-security.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json private_net: type: string @@ -59,7 +54,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} port_security_enabled: False public_port: @@ -71,7 +66,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} port_security_enabled: False outputs: diff --git a/templates/baremetal-ports-public-bond-port-security.yaml b/templates/baremetal-ports-public-bond-port-security.yaml index 5e2d4d7..8e59a45 100644 --- a/templates/baremetal-ports-public-bond-port-security.yaml +++ b/templates/baremetal-ports-public-bond-port-security.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json suffix: type: string @@ -46,7 +41,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} port_security_enabled: False internal_port: @@ -106,7 +101,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} port_security_enabled: False public_bond_port: @@ -118,7 +113,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} port_security_enabled: False outputs: diff --git a/templates/baremetal-ports-public-bond.yaml b/templates/baremetal-ports-public-bond.yaml index 496c63e..b93009a 100644 --- a/templates/baremetal-ports-public-bond.yaml +++ b/templates/baremetal-ports-public-bond.yaml @@ -5,13 +5,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string - description: Name of external network - default: public + networks: + type: json suffix: type: string @@ -46,7 +41,7 @@ resources: - '' - - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: provision_net} + network: {get_param: [networks, provision]} internal_port: type: OS::Neutron::Port @@ -101,7 +96,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} public_bond_port: type: OS::Neutron::Port @@ -112,7 +107,7 @@ resources: - - public_ - {get_param: baremetal_prefix} - {get_param: suffix} - network: {get_param: public_net} + network: {get_param: [networks, public]} outputs: ports: diff --git a/templates/quintupleo.yaml b/templates/quintupleo.yaml index d77ad39..adaacbe 100644 --- a/templates/quintupleo.yaml +++ b/templates/quintupleo.yaml @@ -49,36 +49,6 @@ parameters: default: external description: An external network from which floating ips can be provisioned - provision_net: - type: string - default: provision - description: Name of a network that will be used for provisioning traffic - - provision_net_cidr: - type: string - description: CIDR for provision network subnet - default: 192.0.2.0/24 - - provision_net_shared: - type: boolean - description: Whether this network should be shared across all tenants - default: false - - public_net: - type: string - description: Name of the overcloud external network - default: public - - public_net_cidr: - type: string - description: CIDR for external network subnet - default: 10.0.0.0/24 - - public_net_shared: - type: boolean - description: Whether this network should be shared across all tenants - default: false - bmc_prefix: type: string default: bmc @@ -173,35 +143,8 @@ parameters: resources: - provision_network: - type: OS::Neutron::Net - properties: - name: {get_param: provision_net} - shared: {get_param: provision_net_shared} - - provision_subnet: - type: OS::Neutron::Subnet - properties: - network: {get_resource: provision_network} - name: {get_param: provision_net} - cidr: {get_param: provision_net_cidr} - gateway_ip: null - enable_dhcp: false - - public_network: - type: OS::Neutron::Net - properties: - name: {get_param: public_net} - shared: {get_param: public_net_shared} - - public_subnet: - type: OS::Neutron::Subnet - properties: - network: {get_resource: public_network} - name: {get_param: public_net} - cidr: {get_param: public_net_cidr} - gateway_ip: null - enable_dhcp: false + undercloud_networks: + type: OS::OVB::UndercloudNetworks private_network: type: OS::OVB::PrivateNetwork @@ -211,7 +154,7 @@ resources: undercloud_env: type: OS::OVB::UndercloudEnvironment - depends_on: [provision_subnet, public_subnet] + depends_on: [undercloud_networks, private_network] properties: undercloud_flavor: {get_param: undercloud_flavor} undercloud_image: {get_param: undercloud_image} @@ -220,21 +163,19 @@ resources: undercloud_user_data_format: {get_param: undercloud_user_data_format} undercloud_user_data: {get_param: undercloud_user_data} private_net: {get_attr: [private_network, private_net]} - provision_net: {get_resource: provision_network} - public_net: {get_resource: public_network} + networks: {get_attr: [undercloud_networks, networks]} external_net: {get_param: external_net} baremetal_env: type: OS::OVB::BaremetalEnvironment - depends_on: [provision_subnet, public_subnet] + depends_on: undercloud_networks properties: baremetal_flavor: {get_param: baremetal_flavor} baremetal_image: {get_param: baremetal_image} key_name: {get_param: key_name} node_count: {get_param: node_count} - public_net: {get_resource: public_network} private_net: {get_attr: [private_network, private_net]} - provision_net: {get_resource: provision_network} + networks: {get_attr: [undercloud_networks, networks]} bmc_flavor: {get_param: bmc_flavor} bmc_prefix: {get_param: bmc_prefix} bmc_image: {get_param: bmc_image} diff --git a/templates/resource-registry.yaml b/templates/resource-registry.yaml index 69df109..e6c20ab 100644 --- a/templates/resource-registry.yaml +++ b/templates/resource-registry.yaml @@ -8,3 +8,4 @@ resource_registry: OS::OVB::BaremetalPorts: baremetal-ports-default.yaml OS::OVB::BMCPort: bmc-port.yaml OS::OVB::UndercloudPorts: undercloud-ports.yaml + OS::OVB::UndercloudNetworks: undercloud-networks.yaml diff --git a/templates/undercloud-networks.yaml b/templates/undercloud-networks.yaml new file mode 100644 index 0000000..093e85d --- /dev/null +++ b/templates/undercloud-networks.yaml @@ -0,0 +1,69 @@ +heat_template_version: 2015-04-30 + +parameters: + provision_net: + type: string + default: provision + description: Name of a network that will be used for provisioning traffic + + provision_net_cidr: + type: string + description: CIDR for provision network subnet + default: 192.0.2.0/24 + + provision_net_shared: + type: boolean + description: Whether this network should be shared across all tenants + default: false + + public_net: + type: string + description: Name of the overcloud external network + default: public + + public_net_cidr: + type: string + description: CIDR for external network subnet + default: 10.0.0.0/24 + + public_net_shared: + type: boolean + description: Whether this network should be shared across all tenants + default: false + +resources: + provision_network: + type: OS::Neutron::Net + properties: + name: {get_param: provision_net} + shared: {get_param: provision_net_shared} + + provision_subnet: + type: OS::Neutron::Subnet + properties: + network: {get_resource: provision_network} + name: {get_param: provision_net} + cidr: {get_param: provision_net_cidr} + gateway_ip: null + enable_dhcp: false + + public_network: + type: OS::Neutron::Net + properties: + name: {get_param: public_net} + shared: {get_param: public_net_shared} + + public_subnet: + type: OS::Neutron::Subnet + properties: + network: {get_resource: public_network} + name: {get_param: public_net} + cidr: {get_param: public_net_cidr} + gateway_ip: null + enable_dhcp: false + +outputs: + networks: + value: + provision: {get_resource: provision_network} + public: {get_resource: public_network} diff --git a/templates/undercloud-ports-port-security.yaml b/templates/undercloud-ports-port-security.yaml index 9a0cb2b..1cac893 100644 --- a/templates/undercloud-ports-port-security.yaml +++ b/templates/undercloud-ports-port-security.yaml @@ -8,11 +8,8 @@ parameters: private_net: type: string - provision_net: - type: string - - public_net: - type: string + networks: + type: json resources: undercloud_sg: @@ -53,7 +50,7 @@ resources: - '_' - - {get_param: undercloud_name} - 'provision' - network: {get_param: provision_net} + network: {get_param: [networks, provision]} port_security_enabled: False public_undercloud_port: @@ -64,7 +61,7 @@ resources: - '_' - - {get_param: undercloud_name} - 'public' - network: {get_param: public_net} + network: {get_param: [networks, public]} port_security_enabled: False outputs: diff --git a/templates/undercloud-ports.yaml b/templates/undercloud-ports.yaml index d05b5cb..dc3f1ce 100644 --- a/templates/undercloud-ports.yaml +++ b/templates/undercloud-ports.yaml @@ -8,11 +8,8 @@ parameters: private_net: type: string - provision_net: - type: string - - public_net: - type: string + networks: + type: json resources: undercloud_sg: @@ -53,7 +50,7 @@ resources: - '_' - - {get_param: undercloud_name} - 'provision' - network: {get_param: provision_net} + network: {get_param: [networks, provision]} public_undercloud_port: type: OS::Neutron::Port @@ -63,7 +60,7 @@ resources: - '_' - - {get_param: undercloud_name} - 'public' - network: {get_param: public_net} + network: {get_param: [networks, public]} outputs: ports: diff --git a/templates/undercloud-volume.yaml b/templates/undercloud-volume.yaml index 825edb2..62c39f8 100644 --- a/templates/undercloud-volume.yaml +++ b/templates/undercloud-volume.yaml @@ -19,10 +19,8 @@ parameters: description: The size of the volume for the undercloud instance private_net: type: string - provision_net: - type: string - public_net: - type: string + networks: + type: json external_net: type: string @@ -32,8 +30,7 @@ resources: properties: undercloud_name: {get_param: undercloud_name} private_net: {get_param: private_net} - provision_net: {get_param: provision_net} - public_net: {get_param: public_net} + networks: {get_param: networks} undercloud_volume: type: OS::Cinder::Volume diff --git a/templates/undercloud.yaml b/templates/undercloud.yaml index a6aa640..3b08d6a 100644 --- a/templates/undercloud.yaml +++ b/templates/undercloud.yaml @@ -15,10 +15,8 @@ parameters: type: string private_net: type: string - provision_net: - type: string - public_net: - type: string + networks: + type: json external_net: type: string @@ -28,8 +26,7 @@ resources: properties: undercloud_name: {get_param: undercloud_name} private_net: {get_param: private_net} - provision_net: {get_param: provision_net} - public_net: {get_param: public_net} + networks: {get_param: networks} undercloud_server: type: OS::Nova::Server diff --git a/templates/virtual-baremetal-servers.yaml b/templates/virtual-baremetal-servers.yaml index 8dea67f..0ec471c 100644 --- a/templates/virtual-baremetal-servers.yaml +++ b/templates/virtual-baremetal-servers.yaml @@ -14,11 +14,8 @@ parameters: baremetal_prefix: type: string - provision_net: - type: string - - public_net: - type: string + networks: + type: json suffix: type: string @@ -30,8 +27,7 @@ resources: properties: suffix: {get_param: suffix} baremetal_prefix: {get_param: baremetal_prefix} - provision_net: {get_param: provision_net} - public_net: {get_param: public_net} + networks: {get_param: networks} baremetal_server: type: OS::Nova::Server diff --git a/templates/virtual-baremetal.yaml b/templates/virtual-baremetal.yaml index 25b7758..f5cb6ae 100644 --- a/templates/virtual-baremetal.yaml +++ b/templates/virtual-baremetal.yaml @@ -45,22 +45,15 @@ parameters: default: 1 description: Number of baremetal nodes to deploy - public_net: - type: string - description: | - An additional network that will be attached to the baremetal instances, - intended to be used for non-provisioning traffic - default: public - private_net: type: string default: private description: Name of a private network which can have floating ips associated with it - provision_net: - type: string - default: provision - description: Name of a network that will be used for provisioning traffic + networks: + type: json + default: '{"private": "private", "provision": "provision"}' + description: A map of networks to their names. bmc_prefix: type: string @@ -206,7 +199,6 @@ resources: baremetal_flavor: {get_param: baremetal_flavor} baremetal_image: {get_param: baremetal_image} key_name: {get_param: key_name} - provision_net: {get_param: provision_net} - public_net: {get_param: public_net} + networks: {get_param: networks} suffix: _%index% baremetal_prefix: {get_param: baremetal_prefix}