blob: fd53c824e0b6a9248ea4d6ac003e3bed6caa07e0 [file] [log] [blame]
Matteo Scandolo3896c472017-08-01 13:31:42 -07001{#
2Copyright 2017-present Open Networking Foundation
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15#}
16
Zack Williamsa2763112017-01-03 11:38:38 -070017tosca_definitions_version: tosca_simple_yaml_1_0
18
19imports:
Matteo Scandolo1ed76b82017-12-05 13:58:22 -080020 - custom_types/onosservice.yaml
21 - custom_types/node.yaml
22 - custom_types/node.yaml
Zack Williamsa2763112017-01-03 11:38:38 -070023
24description: Configures VTN networking for OpenStack compute nodes
25
26topology_template:
27 node_templates:
28
29# VTN ONOS app, fully defined in vtn-service.yaml
30 service#ONOS_CORD:
31 type: tosca.nodes.ONOSService
32 properties:
Matteo Scandolo1ed76b82017-12-05 13:58:22 -080033 name: ONOS_CORD
34 must-exist: true
Zack Williamsa2763112017-01-03 11:38:38 -070035
36{% if use_fabric %}
37# Fabric, fully defined in fabric.yaml
38 service#ONOS_Fabric:
39 type: tosca.nodes.ONOSService
40 properties:
Matteo Scandolo1ed76b82017-12-05 13:58:22 -080041 name: ONOS_Fabric
42 must-exist: true
Zack Williamsa2763112017-01-03 11:38:38 -070043{% endif %}
44
45# VTN networking for OpenStack Compute Nodes
Zack Williams5223dd92017-02-28 23:38:02 -070046{% for node in groups['compute'] %}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070047{% for ext_if in computenode_fabric_interfaces %}
Zack Williams6ccbed22017-06-26 13:18:05 -070048{% set ansible_ext_if = 'ansible_' ~ ext_if | regex_replace('\W', '_') %}
49{% if hostvars[node][ansible_ext_if] is defined and 'ipv4' in hostvars[node][ansible_ext_if] %}
50{% set node_interface = hostvars[node][ansible_ext_if] %}
Zack Williamsa2763112017-01-03 11:38:38 -070051
Zack Williams6ccbed22017-06-26 13:18:05 -070052# Compute node: {{ node }}, with interface {{ ansible_ext_if }}
Zack Williamsa2763112017-01-03 11:38:38 -070053 {{ hostvars[node]['ansible_hostname'] }}:
54 type: tosca.nodes.Node
55 properties:
Matteo Scandolo1ed76b82017-12-05 13:58:22 -080056 must-exist: true
57 name: {{ hostvars[node]['ansible_hostname'] }}
Matteo Scandolo7aadb062017-12-07 09:54:25 -080058 bridgeId: of:0000{{ node_interface['macaddress'] | hwaddr('bare') }}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070059 dataPlaneIntf: {{ vtn_integration_bridge_interface }}
Matteo Scandolo7aadb062017-12-07 09:54:25 -080060 dataPlaneIp: {{ ( node_interface['ipv4']['address'] ~ '/' ~ node_interface['ipv4']['netmask'] ) | ipaddr('cidr') }}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070061{% if use_vtn_net_management_host %}
62 hostManagementIface: {{ vtn_net_management_host_interface }}
Zack Williamsa2763112017-01-03 11:38:38 -070063{% endif %}
Zack Williams2f5f2bd2017-12-01 15:04:22 -070064
Zack Williamsa2763112017-01-03 11:38:38 -070065{% endif %}
66{% endfor %}
Zack Williams6ccbed22017-06-26 13:18:05 -070067{% endfor %}
Zack Williamsa2763112017-01-03 11:38:38 -070068