summaryrefslogtreecommitdiffstats
path: root/tosca2heat/heat-translator/translator/tests/data/test_host_assignment.yaml
blob: acffd24bde3987b9313ee0b9c8872fdf1a9045b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
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
      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

    logstash_server:
      type: tosca.nodes.Compute
      capabilities:
        os:
          properties: *os_capabilities
        host:
          properties: *host_capabilities