From ef7a94901d03a82a4faec186fc47dca7044efeab 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 | 5 +++++ lago/templates/sysprep-macros.j2 | 12 ++++++++++++ 3 files changed, 18 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..7cda7d93 --- /dev/null +++ b/lago/templates/sysprep-cirros0.3.5.j2 @@ -0,0 +1,5 @@ +{% import 'sysprep-macros.j2' as macros %} +{% include 'sysprep-base.j2' %} + +{{ macros.iscsi(name=iscsi_name, hostname=hostname) }} +{{ 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 %}