Fix veth-pair role for teardown
* Don't delete the OVS bridge specified, as it will already be deleted when the role is called. * Clarify the behaviour of the role for each value of `cmd` in the README. * Succintify main.yml.
This commit is contained in:
parent
67e8f747d4
commit
956351629f
@ -1,12 +1,16 @@
|
||||
Veth Pair
|
||||
=========
|
||||
|
||||
This role creates a veth pair. It will plug one end into the specified OVS
|
||||
bridge and, optionally, can plug the other end into a source Linux bridge. If
|
||||
`veth_pair_state` is `absent`, it will ensure the veth pair is not plugged into
|
||||
the OVS bridge; if `veth_pair_plug_into_source` is enabled, it will ensure the
|
||||
veth pair is not plugged into the source bridge; finally, it will ensure the
|
||||
veth pair itself does not exist.
|
||||
This role manages a veth pair. Actions:
|
||||
|
||||
* If `veth_pair_state` is `present`, it will create the veth pair and
|
||||
plug one end into the specified OVS bridge. If `veth_pair_plug_into_source`
|
||||
is enabled, it will also plug the other end into/from a source Linux
|
||||
bridge.
|
||||
|
||||
* If `veth_pair_state` is `absent`, it will ensure the veth pair does not exist; if
|
||||
`veth_pair_plug_into_source` is also enabled, it will ensure the veth pair is
|
||||
not plugged into the source bridge.
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
@ -1,11 +1,4 @@
|
||||
---
|
||||
- name: Unplug veth from OVS bridge
|
||||
openvswitch_port:
|
||||
bridge: "{{ veth_pair_ovs_bridge }}"
|
||||
port: "{{ veth_pair_ovs_link_name }}"
|
||||
state: absent
|
||||
become: true
|
||||
|
||||
- name: Unplug veth from source bridge
|
||||
command: >-
|
||||
brctl delif {{ veth_pair_source_bridge }}
|
||||
|
@ -1,8 +1,2 @@
|
||||
---
|
||||
- name: Ensure veth pair is absent
|
||||
include_tasks: absent.yml
|
||||
when: veth_pair_state == 'absent'
|
||||
|
||||
- name: Ensure veth pair is present
|
||||
include_tasks: present.yml
|
||||
when: veth_pair_state != 'absent'
|
||||
- include_tasks: "{{ veth_pair_state }}.yml"
|
||||
|
Loading…
x
Reference in New Issue
Block a user