use an ifup-pre-local for tap device creation
holy crap, this is some ancient magic.
This commit is contained in:
parent
247e9411dc
commit
9ce401e74d
3 changed files with 12 additions and 4 deletions
9
roles/openqa/worker/files/ifup-pre-local
Normal file
9
roles/openqa/worker/files/ifup-pre-local
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
# if the interface being brought up is tap[n], create
|
||||||
|
# the tap device first
|
||||||
|
if=$(echo "$1" | sed -e 's,ifcfg-,,')
|
||||||
|
tap=$(echo "$if" | sed -e 's,[0-9]\+$,,')
|
||||||
|
if [ "$tap" == "tap" ]; then
|
||||||
|
tunctl -u _openqa-worker -p -t "$if"
|
||||||
|
fi
|
|
@ -53,12 +53,11 @@
|
||||||
command: ifup br0
|
command: ifup br0
|
||||||
when: "brstatus.rc > 0"
|
when: "brstatus.rc > 0"
|
||||||
|
|
||||||
- name: Create tap devices
|
- name: Install ifup-pre-local script to create tap devices
|
||||||
command: "tunctl -u _openqa-worker -p -t tap{{ item }} creates=/sys/devices/virtual/net/tap{{ item }}"
|
copy: src=ifup-pre-local dest=/etc/sysconfig/network-scripts/ifup-pre-local owner=root group=root mode=0755
|
||||||
with_sequence: start=0 end={{ openqa_workers | int }}
|
|
||||||
|
|
||||||
- name: openvswitch tap devices config
|
- name: openvswitch tap devices config
|
||||||
template: src=ifcfg-tap dest=/etc/sysconfig/network-scripts/ifcfg-tap{{ item }} owner=root group=root mode=0644
|
template: src=ifcfg-tap.j2 dest=/etc/sysconfig/network-scripts/ifcfg-tap{{ item }} owner=root group=root mode=0644
|
||||||
with_sequence: start=0 end={{ openqa_workers | int }}
|
with_sequence: start=0 end={{ openqa_workers | int }}
|
||||||
notify:
|
notify:
|
||||||
- restart NetworkManager
|
- restart NetworkManager
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue