From 76f4941001045ef9be788e16df554aecb462710f Mon Sep 17 00:00:00 2001 From: Nadav Goldin Date: Thu, 22 Jun 2017 16:15:29 +0300 Subject: [PATCH] CirrOS 0.3.5 support 1. Ensure network scripts are working(on older cirros other interfaces were just not configured properly). 2. Use same domain template as el6 with the normal serial console. Signed-off-by: Nadav Goldin --- .../templates/dom_template-cirros0.3.5.xml.j2 | 1 + lago/templates/sysprep-cirros0.3.5.j2 | 4 ++++ lago/templates/sysprep-macros.j2 | 12 ++++++++++++ 3 files changed, 17 insertions(+) create mode 120000 lago/providers/libvirt/templates/dom_template-cirros0.3.5.xml.j2 create mode 100644 lago/templates/sysprep-cirros0.3.5.j2 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 %}