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