Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 1 | {{/* vim: set filetype=mustache: */}} |
| 2 | {{/* |
| 3 | Copyright 2018-present Open Networking Foundation |
| 4 | |
| 5 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | you may not use this file except in compliance with the License. |
| 7 | You may obtain a copy of the License at |
| 8 | |
| 9 | http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | |
| 11 | Unless required by applicable law or agreed to in writing, software |
| 12 | distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | See the License for the specific language governing permissions and |
| 15 | limitations under the License. |
| 16 | */}} |
| 17 | {{- define "base-openstack.fixtureTosca" -}} |
| 18 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 19 | |
| 20 | imports: |
| 21 | - custom_types/deployment.yaml |
| 22 | - custom_types/site.yaml |
| 23 | - custom_types/networktemplate.yaml |
| 24 | - custom_types/network.yaml |
| 25 | - custom_types/networkslice.yaml |
| 26 | - custom_types/sitedeployment.yaml |
| 27 | |
| 28 | description: set up site and deployment and link them |
| 29 | |
| 30 | topology_template: |
| 31 | node_templates: |
| 32 | |
| 33 | {{ .Values.cordSiteName }}: |
| 34 | type: tosca.nodes.Site |
| 35 | properties: |
| 36 | name: {{ .Values.cordSiteName }} |
| 37 | site_url: http://mysite.opencord.us/ |
| 38 | hosts_nodes: true |
| 39 | |
| 40 | {{ .Values.cordDeploymentName }}: |
| 41 | type: tosca.nodes.Deployment |
| 42 | properties: |
| 43 | name: {{ .Values.cordDeploymentName }} |
| 44 | {{- end -}} |
| 45 | |
| 46 | {{- define "base-openstack.serviceGraphTosca" -}} |
| 47 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 48 | |
| 49 | imports: |
| 50 | - custom_types/onosapp.yaml |
| 51 | - custom_types/servicegraphconstraint.yaml |
| 52 | - custom_types/serviceinstancelink.yaml |
| 53 | - custom_types/vtnservice.yaml |
| 54 | |
| 55 | description: Configures the base-openstack service graph |
| 56 | |
| 57 | topology_template: |
| 58 | node_templates: |
| 59 | |
| 60 | service#vtn: |
| 61 | type: tosca.nodes.VTNService |
| 62 | properties: |
| 63 | name: vtn |
| 64 | must-exist: true |
| 65 | resync: false |
| 66 | |
| 67 | VTN_ONOS_app: |
| 68 | type: tosca.nodes.ONOSApp |
| 69 | properties: |
| 70 | name: VTN_ONOS_app |
| 71 | must-exist: true |
| 72 | |
| 73 | VTN_ONOS_app_VTN_Service: |
| 74 | type: tosca.nodes.ServiceInstanceLink |
| 75 | requirements: |
| 76 | - provider_service_instance: |
| 77 | node: VTN_ONOS_app |
| 78 | relationship: tosca.relationships.BelongsToOne |
| 79 | - subscriber_service: |
| 80 | node: service#vtn |
| 81 | relationship: tosca.relationships.BelongsToOne |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 82 | {{- end -}} |
| 83 | |
| 84 | {{- define "base-openstack.testTosca" -}} |
| 85 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 86 | |
| 87 | imports: |
| 88 | - custom_types/flavor.yaml |
| 89 | - custom_types/image.yaml |
| 90 | - custom_types/site.yaml |
| 91 | - custom_types/network.yaml |
| 92 | - custom_types/networkslice.yaml |
| 93 | - custom_types/slice.yaml |
| 94 | |
| 95 | description: for testing basic openstack functionality |
| 96 | |
| 97 | topology_template: |
| 98 | node_templates: |
| 99 | |
| 100 | Ubuntu-14.04: |
| 101 | type: tosca.nodes.Image |
| 102 | properties: |
| 103 | name: "Ubuntu 14.04 64-bit" |
| 104 | disk_format: QCOW2 |
| 105 | container_format: BARE |
| 106 | path: https://github.com/opencord/platform-install/releases/download/vms/trusty-server-cloudimg-amd64-disk1.img.20170201 |
| 107 | |
| 108 | {{ .Values.cordSiteName }}: |
| 109 | type: tosca.nodes.Site |
| 110 | properties: |
| 111 | name: {{ .Values.cordSiteName }} |
| 112 | must-exist: true |
| 113 | |
| 114 | # Define a test slice |
| 115 | {{ .Values.cordSiteName }}_test: |
| 116 | description: Test Slice |
| 117 | type: tosca.nodes.Slice |
| 118 | properties: |
| 119 | # network: noauto |
| 120 | name: {{ .Values.cordSiteName }}_test |
| 121 | requirements: |
| 122 | - site: |
| 123 | node: {{ .Values.cordSiteName }} |
| 124 | relationship: tosca.relationships.BelongsToOne |
| 125 | - default_image: |
| 126 | node: Ubuntu-14.04 |
| 127 | relationship: tosca.relationships.BelongsToOne |
| 128 | |
| 129 | management: |
| 130 | type: tosca.nodes.Network |
| 131 | properties: |
| 132 | name: management |
| 133 | must-exist: true |
| 134 | |
| 135 | # Connect test slice to management net |
| 136 | networkslice#management_to_{{ .Values.cordSiteName }}_test: |
| 137 | type: tosca.nodes.NetworkSlice |
| 138 | requirements: |
| 139 | - network: |
| 140 | node: management |
| 141 | relationship: tosca.relationships.BelongsToOne |
| 142 | - slice: |
| 143 | node: {{ .Values.cordSiteName }}_test |
| 144 | relationship: tosca.relationships.BelongsToOne |
Andy Bavier | 6e6191a | 2018-05-22 14:53:10 -0700 | [diff] [blame] | 145 | {{- end -}} |
| 146 | |
| 147 | {{- define "base-openstack.computeNodeTosca" -}} |
| 148 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 149 | |
| 150 | imports: |
| 151 | - custom_types/deployment.yaml |
| 152 | - custom_types/node.yaml |
| 153 | - custom_types/site.yaml |
| 154 | - custom_types/sitedeployment.yaml |
| 155 | |
| 156 | description: Adds OpenStack compute nodes |
| 157 | |
| 158 | topology_template: |
| 159 | node_templates: |
| 160 | |
| 161 | # Site/Deployment, fully defined in deployment.yaml |
| 162 | site: |
| 163 | type: tosca.nodes.Site |
| 164 | properties: |
| 165 | name: {{ .Values.cordSiteName }} |
| 166 | must-exist: true |
| 167 | |
| 168 | deployment: |
| 169 | type: tosca.nodes.Deployment |
| 170 | properties: |
| 171 | name: {{ .Values.cordDeploymentName }} |
| 172 | must-exist: true |
| 173 | |
| 174 | site_deployment: |
| 175 | type: tosca.nodes.SiteDeployment |
| 176 | requirements: |
| 177 | - site: |
| 178 | node: site |
| 179 | relationship: tosca.relationships.BelongsToOne |
| 180 | - deployment: |
| 181 | node: deployment |
| 182 | relationship: tosca.relationships.BelongsToOne |
| 183 | |
| 184 | # OpenStack compute nodes |
| 185 | |
| 186 | {{- range .Values.computeNodes }} |
| 187 | {{ .name }}: |
| 188 | type: tosca.nodes.Node |
| 189 | properties: |
| 190 | name: {{ .name }} |
| 191 | bridgeId: {{ .bridgeId }} |
| 192 | dataPlaneIntf: {{ .dataPlaneIntf }} |
| 193 | dataPlaneIp: {{ .dataPlaneIp }} |
| 194 | requirements: |
| 195 | - site_deployment: |
| 196 | node: site_deployment |
| 197 | relationship: tosca.relationships.BelongsToOne |
| 198 | {{- end }} |
| 199 | {{- end -}} |