mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 18:35:13 +00:00
test env: Bring test veth peer up
In order to allows NetworkManager to control veth interface, the veth peer should be in up state and the veth should be marked as managed. Signed-off-by: Gris Ge <fge@redhat.com>
This commit is contained in:
parent
acb1d0165e
commit
ad2a8bfd29
1 changed files with 11 additions and 1 deletions
|
|
@ -17,9 +17,19 @@
|
|||
|
||||
# veth
|
||||
- name: Create veth interface {{ interface }}
|
||||
command: ip link add {{ interface }} type veth peer name peer{{ interface }}
|
||||
command: "{{ item }}"
|
||||
with_items:
|
||||
- ip link add {{ interface }} type veth peer name peer{{ interface }}
|
||||
- ip link set peer{{ interface }} up
|
||||
- ip link set {{ interface }} up
|
||||
when: "type == 'veth' and state == 'present' and
|
||||
interface not in current_interfaces"
|
||||
- name: Set up veth as managed by NetworkManager
|
||||
shell: nmcli d set {{ interface }} managed true
|
||||
# The varible for `network_provider` is not exists yet,
|
||||
# just ignore error for initscripts
|
||||
ignore_errors: yes
|
||||
when: "type == 'veth' and state == 'present'"
|
||||
|
||||
- name: Delete veth interface {{ interface }}
|
||||
command: ip link del {{ interface }} type veth
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue