Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from .sls file:
- {% for hostname in pillar %}
- {% if hostname not in ('alpha', 'beta', 'gamma', 'master') %}
- # set libvirt_uuid = pillar[hostname]['libvirt_uuid']
- /etc/libvirt/qemu/{{ hostname }}.xml:
- file.managed:
- - template: jinja
- - user: root
- - group: root
- - mode: 600
- - source: salt://files/etc/libvirt/qemu/machine.xml
- - context:
- cpu_count: {{ pillar[hostname]['cpu_count'] }}
- hostname: {{ hostname }}
- image_format: {% if hostname in ('bloodhound1', 'placeholder') %}raw{% else %}qcow2{% endif %}
- libvirt_uuid: {{ pillar[hostname]['libvirt_uuid'] }}
- {% if pillar[hostname]['eth0_network'] == '10.0.0.0/24' %}
- master: '10.0.0.1'
- {% else %}
- master: '127.0.0.1'
- {% endif %}
- memory: {{ (pillar[hostname]['memory']*1024*1024)|int }}
- number: {% if pillar[hostname]['number'] < 10 %} '0' + number|string {% else %} number {% endif %}
- {% endif %}
- {% endfor %}
- alternative for master:
- master: {% if pillar[hostname]['eth0_network'] == '10.0.0.0/24' %} '10.0.0.1' {% else %} '127.0.0.1' {% endif %}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement