summaryrefslogtreecommitdiffstats
path: root/roles/openstack-stack/templates/heat_stack_server.yaml.j2
diff options
context:
space:
mode:
authorBogdan Dobrelya <bdobreli@redhat.com>2017-10-16 15:42:42 +0200
committerGitHub <noreply@github.com>2017-10-16 15:42:42 +0200
commitca88364175fe5177cecbb479a157d7329db05d8a (patch)
tree4d17cd0068ab3391ba29a5aeea43706e0e899098 /roles/openstack-stack/templates/heat_stack_server.yaml.j2
parentd83bf080c272516e256ed45bf31c14eee8213f8c (diff)
downloadopenshift-ca88364175fe5177cecbb479a157d7329db05d8a.tar.gz
openshift-ca88364175fe5177cecbb479a157d7329db05d8a.tar.bz2
openshift-ca88364175fe5177cecbb479a157d7329db05d8a.tar.xz
openshift-ca88364175fe5177cecbb479a157d7329db05d8a.zip
Support separate data network for Flannel SDN (#757)
* Support separate data network for Flannel SDN Document the use case for a separate flannel data network. Allow Nova servers for openshift cluster to be provisioned with that isolated data network created and connected to masters, computes and infra nodes. Do not configure dns nameservers and router for that network. Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com> * Fix flannel use cases with provider network Provider network cannot be used with flannel SDN as the latter requires a separate isolated network, while the provider network is an externally managed single network. Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com> * Drop unused data_net_name Signed-off-by: Bogdan Dobrelya <bdobreli@redhat.com>
Diffstat (limited to 'roles/openstack-stack/templates/heat_stack_server.yaml.j2')
-rw-r--r--roles/openstack-stack/templates/heat_stack_server.yaml.j257
1 files changed, 57 insertions, 0 deletions
diff --git a/roles/openstack-stack/templates/heat_stack_server.yaml.j2 b/roles/openstack-stack/templates/heat_stack_server.yaml.j2
index 66c2491a9..6552e0a0d 100644
--- a/roles/openstack-stack/templates/heat_stack_server.yaml.j2
+++ b/roles/openstack-stack/templates/heat_stack_server.yaml.j2
@@ -68,6 +68,28 @@ parameters:
description: Subnet resource
{% endif %}
+{% if openshift_use_flannel|default(False)|bool %}
+ attach_data_net:
+ type: boolean
+ default: false
+ label: Attach-data-net
+ description: A switch for data port connection
+
+ data_net:
+ type: string
+ default: ''
+ label: Net ID
+ description: Net resource
+
+{% if not provider_network %}
+ data_subnet:
+ type: string
+ default: ''
+ label: Subnet ID
+ description: Subnet resource
+{% endif %}
+{% endif %}
+
secgrp:
type: comma_delimited_list
label: Security groups
@@ -133,6 +155,11 @@ outputs:
{% endif %}
- addr
+{% if openshift_use_flannel|default(False)|bool %}
+conditions:
+ no_data_subnet: {not: { get_param: attach_data_net} }
+{% endif %}
+
resources:
server:
@@ -143,11 +170,28 @@ resources:
image: { get_param: image }
flavor: { get_param: flavor }
networks:
+{% if openshift_use_flannel|default(False)|bool %}
+ if:
+ - no_data_subnet
+{% if use_trunk_ports|default(false)|bool %}
+ - - port: { get_attr: [trunk-port, port_id] }
+{% else %}
+ - - port: { get_resource: port }
+{% endif %}
+{% if use_trunk_ports|default(false)|bool %}
+ - - port: { get_attr: [trunk-port, port_id] }
+{% else %}
+ - - port: { get_resource: port }
+ - port: { get_resource: data_port }
+{% endif %}
+
+{% else %}
{% if use_trunk_ports|default(false)|bool %}
- port: { get_attr: [trunk-port, port_id] }
{% else %}
- port: { get_resource: port }
{% endif %}
+{% endif %}
user_data:
get_file: user-data
user_data_format: RAW
@@ -179,6 +223,19 @@ resources:
{% endif %}
security_groups: { get_param: secgrp }
+{% if openshift_use_flannel|default(False)|bool %}
+ data_port:
+ type: OS::Neutron::Port
+ condition: { not: no_data_subnet }
+ properties:
+ network: { get_param: data_net }
+ port_security_enabled: false
+{% if not provider_network %}
+ fixed_ips:
+ - subnet: { get_param: data_subnet }
+{% endif %}
+{% endif %}
+
{% if not provider_network %}
floating-ip:
type: OS::Neutron::FloatingIP