forked from karmab/kcli-ztp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvirtual_platform_hosts.yml
28 lines (26 loc) · 1.38 KB
/
virtual_platform_hosts.yml
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
{% set virtual_masters_number = virtual_masters_number|default(3) %}
{% set virtual_workers_number = virtual_workers_number|default(1) %}
{% if virtual_masters %}
baremetal_masters:
{% for num in range(0, virtual_masters_number) %}
{% set node_name = cluster + "-master-" + num|string %}
- redfish_address: redfish-virtualmedia+http://{{ config_host if config_host != '127.0.0.1' else baremetal_net|local_ip }}:8000/redfish/v1/Systems/{{ node_name|kcli_info('id') }}
{% if baremetal_macs and baremetal_macs|length > num %}
provisioning_mac: {{ baremetal_macs[num] }}
{% elif not provisioning_enable %}
provisioning_mac: {{ virtual_masters_baremetal_mac_prefix + ":" + "%02.d" | format(num + 1)| string }}
{% endif %}
{% endfor %}
{% endif %}
{% if virtual_workers %}
baremetal_workers:
{% for num in range(0, virtual_workers_number) %}
{% set node_name = cluster + "-worker-" + num|string %}
- redfish_address: redfish-virtualmedia+http://{{ config_host if config_host != '127.0.0.1' else baremetal_net|local_ip }}:8000/redfish/v1/Systems/{{ node_name|kcli_info('id') }}
{% if baremetal_macs and baremetal_macs|length > virtual_masters_number + num %}
provisioning_mac: {{ baremetal_macs[virtual_masters_number + num] }}
{% elif not provisioning_enable %}
provisioning_mac: {{ virtual_workers_baremetal_mac_prefix + ":" + "%02.d" | format(num + 1)| string }}
{% endif %}
{% endfor %}
{% endif %}