blob: a61c54fa5a264aa8b0b213d4a22f5c06d7bf21e2 [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'] %}
Zack Williams6ccbed22017-06-26 13:18:05 -070031{% for ext_if in compute_external_interfaces %}
32{% set ansible_ext_if = 'ansible_' ~ ext_if | regex_replace('\W', '_') %}
33{% if hostvars[node][ansible_ext_if] is defined and 'ipv4' in hostvars[node][ansible_ext_if] %}
34{% set node_interface = hostvars[node][ansible_ext_if] %}
Zack Williamsa2763112017-01-03 11:38:38 -070035
Zack Williams6ccbed22017-06-26 13:18:05 -070036# Compute node: {{ node }}, with interface {{ ansible_ext_if }}
Zack Williamsa2763112017-01-03 11:38:38 -070037 {{ hostvars[node]['ansible_hostname'] }}:
38 type: tosca.nodes.Node
39 properties:
40 no-delete: true
41 no-create: true
42 no-update: true
43
44# VTN bridgeId field for node {{ hostvars[node]['ansible_hostname'] }}
45 {{ hostvars[node]['ansible_hostname'] }}_bridgeId_tag:
46 type: tosca.nodes.Tag
47 properties:
48 name: bridgeId
Zack Williams2478b302017-02-14 10:42:55 -070049 value: of:0000{{ node_interface['macaddress'] | hwaddr('bare') }}
Zack Williamsa2763112017-01-03 11:38:38 -070050 requirements:
51 - target:
52 node: {{ hostvars[node]['ansible_hostname'] }}
53 relationship: tosca.relationships.TagsObject
54 - service:
55 node: service#ONOS_CORD
56 relationship: tosca.relationships.MemberOfService
57
58# VTN dataPlaneIntf field for node {{ hostvars[node]['ansible_hostname'] }}
59 {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIntf_tag:
60 type: tosca.nodes.Tag
61 properties:
62 name: dataPlaneIntf
63 value: fabric
64 requirements:
65 - target:
66 node: {{ hostvars[node]['ansible_hostname'] }}
67 relationship: tosca.relationships.TagsObject
68 - service:
69 node: service#ONOS_CORD
70 relationship: tosca.relationships.MemberOfService
71
72# VTN dataPlaneIp field for node {{ hostvars[node]['ansible_hostname'] }}
73 {{ hostvars[node]['ansible_hostname'] }}_dataPlaneIp_tag:
74 type: tosca.nodes.Tag
75 properties:
76 name: dataPlaneIp
Zack Williams2478b302017-02-14 10:42:55 -070077 value: {{ ( node_interface['ipv4']['address'] ~ '/' ~ node_interface['ipv4']['netmask'] ) | ipaddr('cidr') }}
Zack Williamsa2763112017-01-03 11:38:38 -070078 requirements:
79 - target:
80 node: {{ hostvars[node]['ansible_hostname'] }}
81 relationship: tosca.relationships.TagsObject
82 - service:
83 node: service#ONOS_CORD
84 relationship: tosca.relationships.MemberOfService
85
86{% if use_management_hosts %}
87 # VTN management interface field for node {{ hostvars[node]['ansible_hostname'] }}
88 {{ hostvars[node]['ansible_hostname'] }}_hostManagementIface_tag:
89 type: tosca.nodes.Tag
90 properties:
91 name: hostManagementIface
92 value: {{ vtn_management_host_net_interface }}
93 requirements:
94 - target:
95 node: {{ hostvars[node]['ansible_hostname'] }}
96 relationship: tosca.relationships.TagsObject
97 - service:
98 node: service#ONOS_CORD
99 relationship: tosca.relationships.MemberOfService
100{% endif %}
101
102{% if use_fabric %}
103 # Fabric location field for node {{ hostvars[node]['ansible_hostname'] }}
104 {{ hostvars[node]['ansible_hostname'] }}_location_tag:
105 type: tosca.nodes.Tag
106 properties:
107 name: location
108 value: of:0000000000000001/1
109 requirements:
110 - target:
111 node: {{ hostvars[node]['ansible_hostname'] }}
112 relationship: tosca.relationships.TagsObject
113 - service:
114 node: service#ONOS_Fabric
115 relationship: tosca.relationships.MemberOfService
116{% endif %}
Zack Williams6ccbed22017-06-26 13:18:05 -0700117
Zack Williamsa2763112017-01-03 11:38:38 -0700118{% endif %}
119{% endfor %}
Zack Williams6ccbed22017-06-26 13:18:05 -0700120{% endfor %}
Zack Williamsa2763112017-01-03 11:38:38 -0700121