Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 1 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 2 | |
| 3 | imports: |
| 4 | - custom_types/xos.yaml |
| 5 | |
| 6 | description: Configures VTN networking for OpenStack compute nodes |
| 7 | |
| 8 | topology_template: |
| 9 | node_templates: |
| 10 | |
| 11 | # VTN ONOS app, fully defined in vtn-service.yaml |
| 12 | service#ONOS_CORD: |
| 13 | type: tosca.nodes.ONOSService |
| 14 | properties: |
| 15 | no-delete: true |
| 16 | no-create: true |
| 17 | no-update: true |
| 18 | |
| 19 | {% if use_fabric %} |
| 20 | # Fabric, fully defined in fabric.yaml |
| 21 | service#ONOS_Fabric: |
| 22 | type: tosca.nodes.ONOSService |
| 23 | properties: |
| 24 | no-delete: true |
| 25 | no-create: true |
| 26 | no-update: true |
| 27 | {% endif %} |
| 28 | |
| 29 | # VTN networking for OpenStack Compute Nodes |
| 30 | {% for node in groups["compute"] %} |
Zack Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 31 | {% if (('ipv4' in hostvars[node]['ansible_fabric']) or |
| 32 | ('ipv4' in hostvars[node]['ansible_br_int'])) %} |
| 33 | {% if ('ipv4' in hostvars[node]['ansible_fabric']) %} |
| 34 | {% set node_interface = hostvars[node]['ansible_fabric'] %} |
| 35 | {% else %} |
| 36 | {% set node_interface = hostvars[node]['ansible_br_int'] %} |
| 37 | {% endif %} |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 38 | |
| 39 | # Compute node, fully defined in compute-nodes.yaml |
| 40 | {{ hostvars[node]['ansible_hostname'] }}: |
| 41 | type: tosca.nodes.Node |
| 42 | properties: |
| 43 | no-delete: true |
| 44 | no-create: true |
| 45 | no-update: true |
| 46 | |
| 47 | # VTN bridgeId field for node {{ hostvars[node]['ansible_hostname'] }} |
| 48 | {{ hostvars[node]['ansible_hostname'] }}_bridgeId_tag: |
| 49 | type: tosca.nodes.Tag |
| 50 | properties: |
| 51 | name: bridgeId |
Zack Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 52 | value: of:0000{{ node_interface['macaddress'] | hwaddr('bare') }} |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 53 | requirements: |
| 54 | - target: |
| 55 | node: {{ hostvars[node]['ansible_hostname'] }} |
| 56 | relationship: tosca.relationships.TagsObject |
| 57 | - service: |
| 58 | node: service#ONOS_CORD |
| 59 | relationship: tosca.relationships.MemberOfService |
| 60 | |
| 61 | # VTN dataPlaneIntf field for node {{ hostvars[node]['ansible_hostname'] }} |
| 62 | {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIntf_tag: |
| 63 | type: tosca.nodes.Tag |
| 64 | properties: |
| 65 | name: dataPlaneIntf |
| 66 | value: fabric |
| 67 | requirements: |
| 68 | - target: |
| 69 | node: {{ hostvars[node]['ansible_hostname'] }} |
| 70 | relationship: tosca.relationships.TagsObject |
| 71 | - service: |
| 72 | node: service#ONOS_CORD |
| 73 | relationship: tosca.relationships.MemberOfService |
| 74 | |
| 75 | # VTN dataPlaneIp field for node {{ hostvars[node]['ansible_hostname'] }} |
| 76 | {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIp_tag: |
| 77 | type: tosca.nodes.Tag |
| 78 | properties: |
| 79 | name: dataPlaneIp |
Zack Williams | 2478b30 | 2017-02-14 10:42:55 -0700 | [diff] [blame] | 80 | value: {{ ( node_interface['ipv4']['address'] ~ '/' ~ node_interface['ipv4']['netmask'] ) | ipaddr('cidr') }} |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 81 | requirements: |
| 82 | - target: |
| 83 | node: {{ hostvars[node]['ansible_hostname'] }} |
| 84 | relationship: tosca.relationships.TagsObject |
| 85 | - service: |
| 86 | node: service#ONOS_CORD |
| 87 | relationship: tosca.relationships.MemberOfService |
| 88 | |
| 89 | {% if use_management_hosts %} |
| 90 | # VTN management interface field for node {{ hostvars[node]['ansible_hostname'] }} |
| 91 | {{ hostvars[node]['ansible_hostname'] }}_hostManagementIface_tag: |
| 92 | type: tosca.nodes.Tag |
| 93 | properties: |
| 94 | name: hostManagementIface |
| 95 | value: {{ vtn_management_host_net_interface }} |
| 96 | requirements: |
| 97 | - target: |
| 98 | node: {{ hostvars[node]['ansible_hostname'] }} |
| 99 | relationship: tosca.relationships.TagsObject |
| 100 | - service: |
| 101 | node: service#ONOS_CORD |
| 102 | relationship: tosca.relationships.MemberOfService |
| 103 | {% endif %} |
| 104 | |
| 105 | {% if use_fabric %} |
| 106 | # Fabric location field for node {{ hostvars[node]['ansible_hostname'] }} |
| 107 | {{ hostvars[node]['ansible_hostname'] }}_location_tag: |
| 108 | type: tosca.nodes.Tag |
| 109 | properties: |
| 110 | name: location |
| 111 | value: of:0000000000000001/1 |
| 112 | requirements: |
| 113 | - target: |
| 114 | node: {{ hostvars[node]['ansible_hostname'] }} |
| 115 | relationship: tosca.relationships.TagsObject |
| 116 | - service: |
| 117 | node: service#ONOS_Fabric |
| 118 | relationship: tosca.relationships.MemberOfService |
| 119 | {% endif %} |
| 120 | {% endif %} |
| 121 | {% endfor %} |
| 122 | |