Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 1 | tosca_definitions_version: tosca_simple_yaml_1_0 |
| 2 | |
| 3 | imports: |
| 4 | - custom_types/xos.yaml |
| 5 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 6 | description: Adds OpenStack compute nodes |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 7 | |
| 8 | topology_template: |
| 9 | node_templates: |
| 10 | |
| 11 | # Site/Deployment, fully defined in deployment.yaml |
| 12 | {{ site_name }}: |
| 13 | type: tosca.nodes.Site |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 14 | properties: |
| 15 | no-delete: true |
| 16 | no-create: true |
| 17 | no-update: true |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 18 | |
| 19 | {{ deployment_type }}: |
| 20 | type: tosca.nodes.Deployment |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 21 | properties: |
| 22 | no-delete: true |
| 23 | no-create: true |
| 24 | no-update: true |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 25 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 26 | # OpenStack compute nodes |
Zack Williams | 5223dd9 | 2017-02-28 23:38:02 -0700 | [diff] [blame] | 27 | {% for node in groups['compute'] %} |
Zack Williams | 6ccbed2 | 2017-06-26 13:18:05 -0700 | [diff] [blame] | 28 | {% for ext_if in compute_external_interfaces %} |
| 29 | {% set ansible_ext_if = 'ansible_' ~ ext_if | regex_replace('\W', '_') %} |
| 30 | {% if hostvars[node][ansible_ext_if] is defined and 'ipv4' in hostvars[node][ansible_ext_if] %} |
| 31 | {% set node_interface = hostvars[node][ansible_ext_if] %} |
| 32 | |
| 33 | # Compute node: {{ node }}, with interface {{ ansible_ext_if }} |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 34 | {{ hostvars[node]['ansible_hostname'] }}: |
| 35 | type: tosca.nodes.Node |
| 36 | requirements: |
| 37 | - site: |
| 38 | node: {{ site_name }} |
| 39 | relationship: tosca.relationships.MemberOfSite |
| 40 | - deployment: |
| 41 | node: {{ deployment_type }} |
| 42 | relationship: tosca.relationships.MemberOfDeployment |
| 43 | |
Zack Williams | a276311 | 2017-01-03 11:38:38 -0700 | [diff] [blame] | 44 | {% endif %} |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 45 | {% endfor %} |
Zack Williams | 6ccbed2 | 2017-06-26 13:18:05 -0700 | [diff] [blame] | 46 | {% endfor %} |
Zack Williams | 682450e | 2016-11-19 09:04:41 -0700 | [diff] [blame] | 47 | |