Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | {# |
| 2 | Copyright 2017-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | #} |
| 16 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 17 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 18 | |
| 19 | imports: |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 20 | - custom_types/onosservice.yaml |
| 21 | - custom_types/node.yaml |
| 22 | - custom_types/node.yaml |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 23 | |
| 24 | description: Configures VTN networking for OpenStack compute nodes |
| 25 | |
| 26 | topology_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 Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 33 | name: ONOS_CORD |
| 34 | must-exist: true |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 35 | |
| 36 | {% if use_fabric %} |
| 37 | # Fabric, fully defined in fabric.yaml |
| 38 | service#ONOS_Fabric: |
| 39 | type: tosca.nodes.ONOSService |
| 40 | properties: |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 41 | name: ONOS_Fabric |
| 42 | must-exist: true |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 43 | {% endif %} |
| 44 | |
| 45 | # VTN networking for OpenStack Compute Nodes |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 46 | {% for node in groups['compute'] %} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 47 | {% for ext_if in computenode_fabric_interfaces %} |
Zack Williams | 6ccbed2 | 2017-06-26 13:18:05 -0700 | [diff] [blame] | 48 | {% 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 Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 51 | |
Zack Williams | 6ccbed2 | 2017-06-26 13:18:05 -0700 | [diff] [blame] | 52 | # Compute node: {{ node }}, with interface {{ ansible_ext_if }} |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 53 | {{ hostvars[node]['ansible_hostname'] }}: |
| 54 | type: tosca.nodes.Node |
| 55 | properties: |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 56 | must-exist: true |
| 57 | name: {{ hostvars[node]['ansible_hostname'] }} |
Matteo Scandolo | 7aadb06 | 2017-12-07 09:54:25 -0800 | [diff] [blame] | 58 | bridgeId: of:0000{{ node_interface['macaddress'] | hwaddr('bare') }} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 59 | dataPlaneIntf: {{ vtn_integration_bridge_interface }} |
Matteo Scandolo | 7aadb06 | 2017-12-07 09:54:25 -0800 | [diff] [blame] | 60 | dataPlaneIp: {{ ( node_interface['ipv4']['address'] ~ '/' ~ node_interface['ipv4']['netmask'] ) | ipaddr('cidr') }} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 61 | {% if use_vtn_net_management_host %} |
| 62 | hostManagementIface: {{ vtn_net_management_host_interface }} |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 63 | {% endif %} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 64 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 65 | {% endif %} |
| 66 | {% endfor %} |
Zack Williams | 6ccbed2 | 2017-06-26 13:18:05 -0700 | [diff] [blame] | 67 | {% endfor %} |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 68 | |