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 "openstack.flavorTosca" -}} |
| 18 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 19 | |
| 20 | imports: |
| 21 | - custom_types/flavor.yaml |
| 22 | |
| 23 | description: openstack flavor models |
| 24 | |
| 25 | topology_template: |
| 26 | node_templates: |
| 27 | |
| 28 | m1.tiny: |
| 29 | type: tosca.nodes.Flavor |
| 30 | properties: |
| 31 | name: m1.tiny |
Scott Baker | 1d40803 | 2018-08-29 08:34:49 -0700 | [diff] [blame] | 32 | flavor: m1.tiny |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 33 | |
| 34 | m1.small: |
| 35 | type: tosca.nodes.Flavor |
| 36 | properties: |
| 37 | name: m1.small |
Scott Baker | 1d40803 | 2018-08-29 08:34:49 -0700 | [diff] [blame] | 38 | flavor: m1.small |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 39 | |
| 40 | m1.medium: |
| 41 | type: tosca.nodes.Flavor |
| 42 | properties: |
| 43 | name: m1.medium |
Scott Baker | 1d40803 | 2018-08-29 08:34:49 -0700 | [diff] [blame] | 44 | flavor: m1.medium |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 45 | |
| 46 | m1.large: |
| 47 | type: tosca.nodes.Flavor |
| 48 | properties: |
| 49 | name: m1.large |
Scott Baker | 1d40803 | 2018-08-29 08:34:49 -0700 | [diff] [blame] | 50 | flavor: m1.large |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 51 | |
| 52 | m1.xlarge: |
| 53 | type: tosca.nodes.Flavor |
| 54 | properties: |
| 55 | name: m1.xlarge |
Scott Baker | 1d40803 | 2018-08-29 08:34:49 -0700 | [diff] [blame] | 56 | flavor: m1.xlarge |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 57 | {{- end -}} |
| 58 | |
| 59 | {{- define "openstack.networkTosca" -}} |
| 60 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 61 | |
| 62 | imports: |
| 63 | - custom_types/network.yaml |
| 64 | - custom_types/networktemplate.yaml |
| 65 | - custom_types/site.yaml |
| 66 | - custom_types/slice.yaml |
| 67 | |
| 68 | description: openstack flavor models |
| 69 | |
| 70 | topology_template: |
| 71 | node_templates: |
| 72 | |
| 73 | {{ .cordSiteName }}: |
| 74 | type: tosca.nodes.Site |
| 75 | properties: |
| 76 | name: {{ .cordSiteName }} |
| 77 | must-exist: true |
| 78 | |
| 79 | # For private networks (e.g., per-slice) |
| 80 | private_template: |
| 81 | type: tosca.nodes.NetworkTemplate |
| 82 | properties: |
| 83 | name: Private |
| 84 | visibility: private |
| 85 | translation: none |
| 86 | vtn_kind: PRIVATE |
| 87 | |
| 88 | # management (vtn: MANAGEMENT_LOCAL) network |
| 89 | management_template: |
| 90 | type: tosca.nodes.NetworkTemplate |
| 91 | properties: |
| 92 | name: management_template |
| 93 | visibility: private |
| 94 | translation: none |
| 95 | vtn_kind: MANAGEMENT_LOCAL |
| 96 | |
| 97 | management: |
| 98 | type: tosca.nodes.Network |
| 99 | properties: |
| 100 | name: management |
| 101 | # ip_version: 4 |
| 102 | subnet: 172.27.0.0/24 |
| 103 | permit_all_slices: true |
| 104 | requirements: |
| 105 | - template: |
| 106 | node: management_template |
| 107 | relationship: tosca.relationships.BelongsToOne |
| 108 | - owner: |
| 109 | node: slice#{{ .cordSiteName }}_management |
| 110 | relationship: tosca.relationships.BelongsToOne |
| 111 | |
| 112 | # Slice to own management networks |
| 113 | slice#{{ .cordSiteName }}_management: |
| 114 | description: This slice exists solely to own the management network(s) |
| 115 | type: tosca.nodes.Slice |
| 116 | properties: |
| 117 | network: noauto |
| 118 | name: {{ .cordSiteName }}_management |
| 119 | requirements: |
| 120 | - site: |
| 121 | node: {{ .cordSiteName }} |
| 122 | relationship: tosca.relationships.BelongsToOne |
| 123 | {{- end -}} |
| 124 | |
| 125 | {{- define "openstack.controllerTosca" -}} |
| 126 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 127 | |
| 128 | imports: |
| 129 | - custom_types/controller.yaml |
| 130 | - custom_types/controllersite.yaml |
| 131 | - custom_types/deployment.yaml |
| 132 | - custom_types/site.yaml |
| 133 | - custom_types/sitedeployment.yaml |
Scott Baker | a08a2d7 | 2018-05-22 16:09:14 -0700 | [diff] [blame] | 134 | - custom_types/openstackservice.yaml |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 135 | |
| 136 | description: openstack controller models |
| 137 | |
| 138 | topology_template: |
| 139 | node_templates: |
| 140 | |
| 141 | {{ .cordSiteName }}: |
| 142 | type: tosca.nodes.Site |
| 143 | properties: |
| 144 | name: {{ .cordSiteName }} |
| 145 | must-exist: true |
| 146 | |
| 147 | {{ .cordDeploymentName }}: |
| 148 | type: tosca.nodes.Deployment |
| 149 | properties: |
| 150 | name: {{ .cordDeploymentName }} |
| 151 | must-exist: true |
| 152 | |
Scott Baker | a08a2d7 | 2018-05-22 16:09:14 -0700 | [diff] [blame] | 153 | service#openstack: |
| 154 | type: tosca.nodes.OpenStackService |
| 155 | properties: |
| 156 | name: "OpenStack" |
| 157 | auth_url: http://keystone.openstack.svc.cluster.local/v3 |
| 158 | admin_user: {{ .keystoneAdminUser }} |
| 159 | admin_password: {{ .keystoneAdminPassword }} |
| 160 | admin_tenant: {{ .keystoneAdminTenant }} |
| 161 | |
Andy Bavier | 43cdc66 | 2018-05-15 14:50:47 -0700 | [diff] [blame] | 162 | {{ .cordSiteName }}_{{ .cordDeploymentName }}_openstack: |
| 163 | type: tosca.nodes.Controller |
| 164 | requirements: |
| 165 | - deployment: |
| 166 | node: {{ .cordDeploymentName }} |
| 167 | relationship: tosca.relationships.BelongsToOne |
| 168 | properties: |
| 169 | name: {{ .cordSiteName }}_{{ .cordDeploymentName }}_openstack |
| 170 | backend_type: OpenStack |
| 171 | version: Newton |
| 172 | auth_url: http://keystone.openstack.svc.cluster.local/v3 |
| 173 | admin_user: {{ .keystoneAdminUser }} |
| 174 | admin_password: {{ .keystoneAdminPassword }} |
| 175 | admin_tenant: {{ .keystoneAdminTenant }} |
| 176 | domain: {{ .keystoneDomain }} |
| 177 | |
| 178 | {{ .cordSiteName }}_deployment_{{ .cordDeploymentName }}: |
| 179 | type: tosca.nodes.SiteDeployment |
| 180 | requirements: |
| 181 | - site: |
| 182 | node: {{ .cordSiteName }} |
| 183 | relationship: tosca.relationships.BelongsToOne |
| 184 | - deployment: |
| 185 | node: {{ .cordDeploymentName }} |
| 186 | relationship: tosca.relationships.BelongsToOne |
| 187 | - controller: |
| 188 | node: {{ .cordSiteName }}_{{ .cordDeploymentName }}_openstack |
| 189 | relationship: tosca.relationships.BelongsToOne |
| 190 | |
| 191 | {{ .cordSiteName }}_openstack_controller: |
| 192 | type: tosca.nodes.ControllerSite |
| 193 | requirements: |
| 194 | - site: |
| 195 | node: {{ .cordSiteName }} |
| 196 | relationship: tosca.relationships.BelongsToOne |
| 197 | - controller: |
| 198 | node: {{ .cordSiteName }}_{{ .cordDeploymentName }}_openstack |
| 199 | relationship: tosca.relationships.BelongsToOne |
| 200 | {{- end -}} |