Matteo Scandolo | 3896c47 | 2017-08-01 13:31:42 -0700 | [diff] [blame] | 1 | {# |
| 2 | Copyright 2017-present Open Networking Foundation |
| 3 | |
| 4 | Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | you may not use this file except in compliance with the License. |
| 6 | You may obtain a copy of the License at |
| 7 | |
| 8 | http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | |
| 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | #} |
| 16 | |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 17 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 18 | |
| 19 | imports: |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 20 | - custom_types/deployment.yaml |
| 21 | - custom_types/node.yaml |
| 22 | - custom_types/site.yaml |
| 23 | - custom_types/sitedeployment.yaml |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 24 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 25 | description: Adds OpenStack compute nodes |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 26 | |
| 27 | topology_template: |
| 28 | node_templates: |
| 29 | |
| 30 | # Site/Deployment, fully defined in deployment.yaml |
| 31 | {{ site_name }}: |
| 32 | type: tosca.nodes.Site |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 33 | properties: |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 34 | name: {{ site_name }} |
| 35 | must-exist: true |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 36 | |
| 37 | {{ deployment_type }}: |
| 38 | type: tosca.nodes.Deployment |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 39 | properties: |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 40 | name: {{ deployment_type }} |
| 41 | must-exist: true |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 42 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 43 | # OpenStack compute nodes |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 44 | {% for node in groups['compute'] %} |
Zack Williams | 2f5f2bd | 2017-12-01 15:04:22 -0700 | [diff] [blame] | 45 | {% for ext_if in computenode_fabric_interfaces %} |
Zack Williams | 6ccbed2 | 2017-06-26 13:18:05 -0700 | [diff] [blame] | 46 | {% set ansible_ext_if = 'ansible_' ~ ext_if | regex_replace('\W', '_') %} |
| 47 | {% if hostvars[node][ansible_ext_if] is defined and 'ipv4' in hostvars[node][ansible_ext_if] %} |
| 48 | {% set node_interface = hostvars[node][ansible_ext_if] %} |
| 49 | |
| 50 | # Compute node: {{ node }}, with interface {{ ansible_ext_if }} |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 51 | {{ hostvars[node]['ansible_hostname'] }}: |
| 52 | type: tosca.nodes.Node |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 53 | properties: |
| 54 | name: {{ hostvars[node]['ansible_hostname'] }} |
| 55 | requirements: |
| 56 | - site_deployment: |
| 57 | node: {{ site_name }}_{{ deployment_type }} |
| 58 | relationship: tosca.relationships.BelongsToOne |
| 59 | |
| 60 | {{ site_name }}_{{ deployment_type }}: |
| 61 | type: tosca.nodes.SiteDeployment |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 62 | requirements: |
| 63 | - site: |
| 64 | node: {{ site_name }} |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 65 | relationship: tosca.relationships.BelongsToOne |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 66 | - deployment: |
| 67 | node: {{ deployment_type }} |
Matteo Scandolo | 1ed76b8 | 2017-12-05 13:58:22 -0800 | [diff] [blame] | 68 | relationship: tosca.relationships.BelongsToOne |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 69 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 70 | {% endif %} |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 71 | {% endfor %} |
Zack Williams | 6ccbed2 | 2017-06-26 13:18:05 -0700 | [diff] [blame] | 72 | {% endfor %} |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 73 | |