7040199ff3b03da176dc8141546b67224c8f4cd8
[icn.git] / deploy / metal3-vm / vm-setup / roles / libvirt / templates / ironic_nodes.json.j2
1 {% set lvars = { 'host_ip' : '192.168.122.1', 'pxe_network' : False} %}
2 {% for network in networks %}
3 {% if (not (network.forward_mode is defined and network.forward_mode == 'nat') and lvars['pxe_network'] == False) %}
4 {% if lvars.update({'pxe_network' : network.name}) %}{% endif %}
5 {% endif %}
6 {% if network.address is defined and lvars['host_ip'] == '192.168.122.1' %}
7 {% if lvars.update({'host_ip' : network.address}) %}{% endif %}
8 {% endif %}
9 {% endfor %}
10 {
11   "nodes": [
12   {% for node in vm_nodes %}
13     {
14       "name": "{{ node.name|replace('_', '-') }}",
15       "driver": "ipmi",
16       "resource_class": "baremetal",
17       "driver_info": {
18         "ipmi_username": "admin",
19         "ipmi_password": "password",
20         "ipmi_address": "{{ lvars['host_ip'] }}",
21         "ipmi_port": "{{ node.virtualbmc_port }}",
22         "deploy_kernel": "http://172.22.0.1/images/ironic-python-agent.kernel",
23         "deploy_ramdisk": "http://172.22.0.1/images/ironic-python-agent.initramfs"
24       },
25       "ports": [{
26         "address": "{{ node_mac_map.get(node.name).get(lvars['pxe_network']) }}",
27         "pxe_enabled": true
28       }],
29       "properties": {
30         "local_gb": "{{ flavors[node.flavor].disk }}",
31         "cpu_arch": "{{ libvirt_arch }}"
32       }
33     }
34     {% if not loop.last %}
35     ,
36     {% endif %}
37   {% endfor %}
38   ]
39 }