From bebf48ab53da34471fee621f46f98e8e38dad021 Mon Sep 17 00:00:00 2001 From: Markos Chandras Date: Mon, 17 Jul 2017 12:10:03 +0100 Subject: [PATCH] test-prepare-host: SUSE: Fix nested POST_{UP,DOWN} logic The nested loop was wrong since it led to broken entries in the ifcfg files POST_UP_SCRIPT="compat:suse:ifup-post-veth-br-vlan-2-eth12" POST_UP_SCRIPT="compat:suse:ifdown-post-veth-br-vlan-2-eth12" POST_DOWN_SCRIPTS="compat:suse:ifup-post-veth-br-vlan-2-eth12" POST_DOWN_SCRIPTS="compat:suse:ifdown-post-veth-br-vlan-2-eth12" The reason for that was that we added both ifup/ifdown entries on both the POST_UP and POST_DOWN variables which was clearly wrong. As such, we adapt the ifup/ifdown lists to include only the appropriate items for each POST_UP and POST_DOWN variables. Change-Id: Ibff6be57f0d5cec97b9986a9f6f00903f28ec35c --- test-prepare-host.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test-prepare-host.yml b/test-prepare-host.yml index e8344472..ee54b503 100644 --- a/test-prepare-host.yml +++ b/test-prepare-host.yml @@ -125,14 +125,14 @@ dest: "/etc/sysconfig/network/ifcfg-{{ item[1].name | default('br-mgmt') }}" line: "POST_UP_SCRIPT=\"compat:suse:{{ item[0] }}-veth-{{ item[1].name | default('br-mgmt') }}-2-{{ item[1].veth_peer | default('eth1') }}\"" with_nested: - - [ "ifup-post", "ifdown-post" ] + - ['ifup-post'] - "{{ bridges }}" - name: Configure ifcfg files to use the post-down script (SUSE) lineinfile: dest: "/etc/sysconfig/network/ifcfg-{{ item[1].name | default('br-mgmt') }}" line: "POST_DOWN_SCRIPTS=\"compat:suse:{{ item[0] }}-veth-{{ item[1].name | default('br-mgmt') }}-2-{{ item[1].veth_peer | default('eth1') }}\"" with_nested: - - [ "ifup-post", "ifdown-post" ] + - ['ifdown-post'] - "{{ bridges }}" when: - item[1].veth_peer is defined