blob: b43e1e3bc833cb6cfdcfce7bafb6c08eb707ea51 [file] [log] [blame]
Zack Williamsa2763112017-01-03 11:38:38 -07001tosca_definitions_version: tosca_simple_yaml_1_0
2
3imports:
4 - custom_types/xos.yaml
5
6description: Configures VTN networking for OpenStack compute nodes
7
8topology_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"] %}
31{% if 'ipv4' in hostvars[node]['ansible_fabric'] %}
32
33# Compute node, fully defined in compute-nodes.yaml
34 {{ hostvars[node]['ansible_hostname'] }}:
35 type: tosca.nodes.Node
36 properties:
37 no-delete: true
38 no-create: true
39 no-update: true
40
41# VTN bridgeId field for node {{ hostvars[node]['ansible_hostname'] }}
42 {{ hostvars[node]['ansible_hostname'] }}_bridgeId_tag:
43 type: tosca.nodes.Tag
44 properties:
45 name: bridgeId
46 value: of:0000{{ hostvars[node]['ansible_fabric']['macaddress'] | hwaddr('bare') }}
47 requirements:
48 - target:
49 node: {{ hostvars[node]['ansible_hostname'] }}
50 relationship: tosca.relationships.TagsObject
51 - service:
52 node: service#ONOS_CORD
53 relationship: tosca.relationships.MemberOfService
54
55# VTN dataPlaneIntf field for node {{ hostvars[node]['ansible_hostname'] }}
56 {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIntf_tag:
57 type: tosca.nodes.Tag
58 properties:
59 name: dataPlaneIntf
60 value: fabric
61 requirements:
62 - target:
63 node: {{ hostvars[node]['ansible_hostname'] }}
64 relationship: tosca.relationships.TagsObject
65 - service:
66 node: service#ONOS_CORD
67 relationship: tosca.relationships.MemberOfService
68
69# VTN dataPlaneIp field for node {{ hostvars[node]['ansible_hostname'] }}
70 {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIp_tag:
71 type: tosca.nodes.Tag
72 properties:
73 name: dataPlaneIp
74 value: {{ ( hostvars[node]['ansible_fabric']['ipv4']['address'] ~ '/' ~ hostvars[node]['ansible_fabric']['ipv4']['netmask'] ) | ipaddr('cidr') }}
75 requirements:
76 - target:
77 node: {{ hostvars[node]['ansible_hostname'] }}
78 relationship: tosca.relationships.TagsObject
79 - service:
80 node: service#ONOS_CORD
81 relationship: tosca.relationships.MemberOfService
82
83{% if use_management_hosts %}
84 # VTN management interface field for node {{ hostvars[node]['ansible_hostname'] }}
85 {{ hostvars[node]['ansible_hostname'] }}_hostManagementIface_tag:
86 type: tosca.nodes.Tag
87 properties:
88 name: hostManagementIface
89 value: {{ vtn_management_host_net_interface }}
90 requirements:
91 - target:
92 node: {{ hostvars[node]['ansible_hostname'] }}
93 relationship: tosca.relationships.TagsObject
94 - service:
95 node: service#ONOS_CORD
96 relationship: tosca.relationships.MemberOfService
97{% endif %}
98
99{% if use_fabric %}
100 # Fabric location field for node {{ hostvars[node]['ansible_hostname'] }}
101 {{ hostvars[node]['ansible_hostname'] }}_location_tag:
102 type: tosca.nodes.Tag
103 properties:
104 name: location
105 value: of:0000000000000001/1
106 requirements:
107 - target:
108 node: {{ hostvars[node]['ansible_hostname'] }}
109 relationship: tosca.relationships.TagsObject
110 - service:
111 node: service#ONOS_Fabric
112 relationship: tosca.relationships.MemberOfService
113{% endif %}
114{% endif %}
115{% endfor %}
116