summaryrefslogtreecommitdiffstats
path: root/roles/openstack-stack/templates/heat_stack_server.yaml.j2
diff options
context:
space:
mode:
authorTomas Sedovic <tomas@sedovic.cz>2017-09-06 10:24:16 +0200
committerGitHub <noreply@github.com>2017-09-06 10:24:16 +0200
commitdaa0b91119d2c16860a19b4ead2d0d128f8bc5ce (patch)
treec6b8f333cb16048e68983a0b885eb74830577cfc /roles/openstack-stack/templates/heat_stack_server.yaml.j2
parent06abd17792fafc3adec3916f56c69800690b1431 (diff)
downloadopenshift-daa0b91119d2c16860a19b4ead2d0d128f8bc5ce.tar.gz
openshift-daa0b91119d2c16860a19b4ead2d0d128f8bc5ce.tar.bz2
openshift-daa0b91119d2c16860a19b4ead2d0d128f8bc5ce.tar.xz
openshift-daa0b91119d2c16860a19b4ead2d0d128f8bc5ce.zip
Allow using a provider network (#701)
* Allow using a provider network This adds a new option `openstack_provider_network_name` which will take a name of an existing network and put the servers there. It will also prevent creating floating IP addresses as the provider network's IPs should already be accessible without any additional routing required. Fixes #622 * Requested changes Don't fail on external/private networks and use role defaults for the provider network. * Add missing endif
Diffstat (limited to 'roles/openstack-stack/templates/heat_stack_server.yaml.j2')
-rw-r--r--roles/openstack-stack/templates/heat_stack_server.yaml.j212
1 files changed, 12 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 32fb166f6..a520a8fe2 100644
--- a/roles/openstack-stack/templates/heat_stack_server.yaml.j2
+++ b/roles/openstack-stack/templates/heat_stack_server.yaml.j2
@@ -61,20 +61,24 @@ parameters:
label: Net name
description: Net name
+{% if not provider_network %}
subnet:
type: string
label: Subnet ID
description: Subnet resource
+{% endif %}
secgrp:
type: comma_delimited_list
label: Security groups
description: Security group resources
+{% if not provider_network %}
floating_network:
type: string
label: Floating network
description: Network to allocate floating IP from
+{% endif %}
availability_zone:
type: string
@@ -117,7 +121,11 @@ outputs:
- server
- addresses
- { get_param: net_name }
+{% if provider_network %}
+ - 0
+{% else %}
- 1
+{% endif %}
- addr
resources:
@@ -147,15 +155,19 @@ resources:
type: OS::Neutron::Port
properties:
network: { get_param: net }
+{% if not provider_network %}
fixed_ips:
- subnet: { get_param: subnet }
+{% endif %}
security_groups: { get_param: secgrp }
+{% if not provider_network %}
floating-ip:
type: OS::Neutron::FloatingIP
properties:
floating_network: { get_param: floating_network }
port_id: { get_resource: port }
+{% endif %}
{% if not ephemeral_volumes|default(false)|bool %}
cinder_volume: