[vnode parsing] Move core logic to j2
[fuel.git] / mcp / config / scenario / os-nosdn-nofeature-novcp-ha.yaml.j2
1 ##############################################################################
2 # Copyright (c) 2018 Mirantis Inc., Enea AB and others.
3 # All rights reserved. This program and the accompanying materials
4 # are made available under the terms of the Apache License, Version 2.0
5 # which accompanies this distribution, and is available at
6 # http://www.apache.org/licenses/LICENSE-2.0
7 ##############################################################################
8 {%- import 'net_map.j2' as nm with context %}
9 {%- set cluster = {'has_virtual_nodes': False} %}
10 {%- for node in conf.nodes %}
11   {%- if not cluster.has_virtual_nodes and node.node.type == 'baremetal' %}
12     {%- do cluster.update({'has_baremetal_nodes': True}) %}
13   {%- endif %}
14 {%- endfor %}
15 ---
16 cluster:
17   domain: mcp-pike-ovs-novcp-ha.local
18   states:
19 {%- if cluster.has_baremetal_nodes %}
20     - maas
21     - baremetal_init
22 {%- endif %}
23     - openstack_ha
24     - networks
25 virtual:
26   nodes:
27     - cfg01
28 {%- if cluster.has_baremetal_nodes %}
29     - mas01
30 {%- endif %}
31 {#- Most likely, controllers will always have the same type and number (3) #}
32 {%- if conf.nodes[nm.ctl01.idx].node.type == 'virtual' %}
33     - kvm01
34     - kvm02
35     - kvm03
36 {%- endif %}
37 {#- Later, we might have mixed computes here, for hybrid multi-arch testing #}
38 {%- if conf.nodes[nm.cmp001.idx].node.type == 'virtual' %}
39     - cmp001
40     - cmp002
41 {%- endif %}
42   cfg01:
43     vcpus: 4
44     ram: 6144
45   # Below values are only used when nodes are defined in virtual.nodes above
46   mas01:
47     vcpus: 4
48     ram: 6144
49   # NOTE: We might need to add more RAM here
50   kvm01:
51     vcpus: 4
52     ram: 14336
53   kvm02:
54     vcpus: 4
55     ram: 14336
56   kvm03:
57     vcpus: 4
58     ram: 14336