blob: 6e76a43c58c727d40e2d57260c52a9a2d4ce9bde [file] [log] [blame]
tosca_definitions_version: tosca_simple_yaml_1_0
imports:
- custom_types/xos.yaml
description: Adds OpenStack compute nodes
topology_template:
node_templates:
# Site/Deployment, fully defined in deployment.yaml
{{ site_name }}:
type: tosca.nodes.Site
properties:
no-delete: true
no-create: true
no-update: true
{{ deployment_type }}:
type: tosca.nodes.Deployment
properties:
no-delete: true
no-create: true
no-update: true
# OpenStack compute nodes
{% for node in groups['compute'] %}
{% for ext_if in compute_external_interfaces %}
{% set ansible_ext_if = 'ansible_' ~ ext_if | regex_replace('\W', '_') %}
{% if hostvars[node][ansible_ext_if] is defined and 'ipv4' in hostvars[node][ansible_ext_if] %}
{% set node_interface = hostvars[node][ansible_ext_if] %}
# Compute node: {{ node }}, with interface {{ ansible_ext_if }}
{{ hostvars[node]['ansible_hostname'] }}:
type: tosca.nodes.Node
requirements:
- site:
node: {{ site_name }}
relationship: tosca.relationships.MemberOfSite
- deployment:
node: {{ deployment_type }}
relationship: tosca.relationships.MemberOfDeployment
{% endif %}
{% endfor %}
{% endfor %}