diff --git a/lago/providers/libvirt/templates/dom_template-cirros0.3.5.xml.j2 b/lago/providers/libvirt/templates/dom_template-cirros0.3.5.xml.j2 new file mode 120000 index 00000000..9038d619 --- /dev/null +++ b/lago/providers/libvirt/templates/dom_template-cirros0.3.5.xml.j2 @@ -0,0 +1 @@ +dom_template-el6.xml.j2 \ No newline at end of file diff --git a/lago/templates/sysprep-cirros0.3.5.j2 b/lago/templates/sysprep-cirros0.3.5.j2 new file mode 100644 index 00000000..73a5176e --- /dev/null +++ b/lago/templates/sysprep-cirros0.3.5.j2 @@ -0,0 +1,4 @@ +{% import 'sysprep-macros.j2' as macros %} +{% include 'sysprep-base.j2' %} + +{{ macros.network_devices_cirros(mappings=mappings) }} diff --git a/lago/templates/sysprep-macros.j2 b/lago/templates/sysprep-macros.j2 index 73b89fd6..797fe4e6 100644 --- a/lago/templates/sysprep-macros.j2 +++ b/lago/templates/sysprep-macros.j2 @@ -37,3 +37,15 @@ source /etc/network/interfaces.d/*.cfg \ {% endfor %} {% endfilter %} {% endmacro %} + + +{% macro network_devices_cirros(mappings) %} +write /etc/network/interfaces:auto lo \ +iface lo inet loopback \ +{% filter dedent %} +{%+ for iface, mac in mappings.viewitems() %} + auto {{ iface }} \ + iface {{ iface }} inet dhcp \ +{% endfor %} +{% endfilter %} +{% endmacro %}