blob: 88ab8d1f1301c52d99dbf7430f3b31551382e3c9 [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
Zack Williams5223dd92017-02-28 23:38:02 -070030{% for node in groups['compute'] %}
31{% if 'ipv4' in hostvars[node]['ansible_' ~ compute_external_interface] %}
32{% set node_interface = hostvars[node]['ansible_' ~ compute_external_interface] %}
Zack Williamsa2763112017-01-03 11:38:38 -070033
34# Compute node, fully defined in compute-nodes.yaml
35 {{ hostvars[node]['ansible_hostname'] }}:
36 type: tosca.nodes.Node
37 properties:
38 no-delete: true
39 no-create: true
40 no-update: true
41
42# VTN bridgeId field for node {{ hostvars[node]['ansible_hostname'] }}
43 {{ hostvars[node]['ansible_hostname'] }}_bridgeId_tag:
44 type: tosca.nodes.Tag
45 properties:
46 name: bridgeId
Zack Williams2478b302017-02-14 10:42:55 -070047 value: of:0000{{ node_interface['macaddress'] | hwaddr('bare') }}
Zack Williamsa2763112017-01-03 11:38:38 -070048 requirements:
49 - target:
50 node: {{ hostvars[node]['ansible_hostname'] }}
51 relationship: tosca.relationships.TagsObject
52 - service:
53 node: service#ONOS_CORD
54 relationship: tosca.relationships.MemberOfService
55
56# VTN dataPlaneIntf field for node {{ hostvars[node]['ansible_hostname'] }}
57 {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIntf_tag:
58 type: tosca.nodes.Tag
59 properties:
60 name: dataPlaneIntf
61 value: fabric
62 requirements:
63 - target:
64 node: {{ hostvars[node]['ansible_hostname'] }}
65 relationship: tosca.relationships.TagsObject
66 - service:
67 node: service#ONOS_CORD
68 relationship: tosca.relationships.MemberOfService
69
70# VTN dataPlaneIp field for node {{ hostvars[node]['ansible_hostname'] }}
71 {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIp_tag:
72 type: tosca.nodes.Tag
73 properties:
74 name: dataPlaneIp
Zack Williams2478b302017-02-14 10:42:55 -070075 value: {{ ( node_interface['ipv4']['address'] ~ '/' ~ node_interface['ipv4']['netmask'] ) | ipaddr('cidr') }}
Zack Williamsa2763112017-01-03 11:38:38 -070076 requirements:
77 - target:
78 node: {{ hostvars[node]['ansible_hostname'] }}
79 relationship: tosca.relationships.TagsObject
80 - service:
81 node: service#ONOS_CORD
82 relationship: tosca.relationships.MemberOfService
83
84{% if use_management_hosts %}
85 # VTN management interface field for node {{ hostvars[node]['ansible_hostname'] }}
86 {{ hostvars[node]['ansible_hostname'] }}_hostManagementIface_tag:
87 type: tosca.nodes.Tag
88 properties:
89 name: hostManagementIface
90 value: {{ vtn_management_host_net_interface }}
91 requirements:
92 - target:
93 node: {{ hostvars[node]['ansible_hostname'] }}
94 relationship: tosca.relationships.TagsObject
95 - service:
96 node: service#ONOS_CORD
97 relationship: tosca.relationships.MemberOfService
98{% endif %}
99
100{% if use_fabric %}
101 # Fabric location field for node {{ hostvars[node]['ansible_hostname'] }}
102 {{ hostvars[node]['ansible_hostname'] }}_location_tag:
103 type: tosca.nodes.Tag
104 properties:
105 name: location
106 value: of:0000000000000001/1
107 requirements:
108 - target:
109 node: {{ hostvars[node]['ansible_hostname'] }}
110 relationship: tosca.relationships.TagsObject
111 - service:
112 node: service#ONOS_Fabric
113 relationship: tosca.relationships.MemberOfService
114{% endif %}
115{% endif %}
116{% endfor %}
117