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
This commit is contained in:
Markos Chandras 2017-07-17 12:10:03 +01:00
parent b29e4c523c
commit bebf48ab53
1 changed files with 2 additions and 2 deletions

View File

@ -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