Files
heat-translator/samples/tests/data/test_host_assignment.yaml
Yasufumi Ogawa 098b9db0d4 Fix CI failures
1. Use stestr instead of deprecated running setup.py directly.

2. Stricter relationship validation in tosca-parser v2.13.0 caused
   template validation errors as similar to [1].

3. Since several depending packages are too old and failed to path
   unittests, update version of the packages.

[1] https://review.opendev.org/c/openstack/tacker/+/956458

Change-Id: I2b317f2c58518ae40b9c22dd1398a018580dc3cc
Signed-off-by: Yasufumi Ogawa <yasufum.o@gmail.com>
Co-authored-by: Shivam Shukla <shivam.shukla3@india.nec.com>
2025-09-13 07:06:58 +09:00

91 lines
2.5 KiB
YAML

tosca_definitions_version: tosca_simple_yaml_1_0
description: >
A template to test host assignment for translated hot resources.
It makes sure if a resource depends on multiple hosts only the
one with the "HostedOn" relationship is picked as the host. In
this template, the translated resource 'app_collectd_create_deploy'
would depend on 'logstash_server' and 'app_server'. But it would
have "HostedOn" relationship with 'app_server', and that server
would be its host.
imports:
- custom_types/logstash.yaml
- custom_types/collectd.yaml
- custom_types/rsyslog.yaml
- custom_types/elasticsearch.yaml
dsl_definitions:
host_capabilities: &host_capabilities
# compute properties (flavor)
disk_size: 10 GB
num_cpus: 1
mem_size: 4096 MB
os_capabilities: &os_capabilities
architecture: x86_64
type: Linux
distribution: Ubuntu
version: 14.04
topology_template:
node_templates:
app_collectd:
type: tosca.nodes.SoftwareComponent.Collectd
requirements:
- host:
node: app_server
- log_endpoint:
node: logstash
capability: log_endpoint
relationship:
type: tosca.relationships.ConnectsTo
interfaces:
Configure:
pre_configure_target:
implementation: logstash/configure_collectd.py
interfaces:
Standard:
create: collectd/create.sh
configure:
implementation: collectd/config.py
inputs:
logstash_ip: { get_attribute: [logstash_server, private_address] }
start: collectd/start.sh
logstash:
type: tosca.nodes.SoftwareComponent.Logstash
requirements:
- host:
node: logstash_server
- search_endpoint:
node: elasticsearch_server
interfaces:
Standard:
create: logstash/create.sh
start: logstash/start.sh
app_server:
type: tosca.nodes.Compute
capabilities:
os:
properties: *os_capabilities
host:
properties: *host_capabilities
elasticsearch_server:
type: tosca.nodes.Compute
capabilities:
host:
properties: *host_capabilities
os:
properties: *os_capabilities
logstash_server:
type: tosca.nodes.Compute
capabilities:
os:
properties: *os_capabilities
host:
properties: *host_capabilities