2017-06-12 11:13:41 +00:00
|
|
|
---
|
|
|
|
|
2017-11-21 12:34:27 +00:00
|
|
|
- name: Make sure test bridge does not exist before tests
|
|
|
|
command: ovs-vsctl del-br br-test
|
|
|
|
ignore_errors: yes
|
|
|
|
|
|
|
|
- name: Create test bridge
|
|
|
|
command: ovs-vsctl add-br br-test
|
2017-06-12 11:13:41 +00:00
|
|
|
|
2017-06-12 15:41:10 +00:00
|
|
|
- name: Create bridge
|
|
|
|
openvswitch_db:
|
2017-06-12 11:13:41 +00:00
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: true
|
2017-06-12 15:48:59 +00:00
|
|
|
register: result
|
2017-06-12 11:13:41 +00:00
|
|
|
|
2017-06-12 15:41:10 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: Create bridge again (idempotent)
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: true
|
2017-06-12 15:48:59 +00:00
|
|
|
register: result
|
2017-06-12 15:41:10 +00:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-08-08 14:01:42 +00:00
|
|
|
- name: Change column value in a map
|
2017-06-12 15:41:10 +00:00
|
|
|
openvswitch_db:
|
2017-06-12 11:13:41 +00:00
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
2017-06-12 15:48:59 +00:00
|
|
|
register: result
|
2017-06-12 11:13:41 +00:00
|
|
|
|
2017-06-12 15:41:10 +00:00
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
2018-08-08 14:01:42 +00:00
|
|
|
- name: Change column value in a map again (idempotent)
|
2017-06-12 15:41:10 +00:00
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
2017-06-12 15:48:59 +00:00
|
|
|
register: result
|
2017-06-12 15:41:10 +00:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
2018-08-08 14:01:42 +00:00
|
|
|
- name: Change column value
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: stp_enable
|
2018-08-10 05:01:03 +00:00
|
|
|
value: 'true'
|
|
|
|
become: yes
|
2018-08-08 14:01:42 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: Change column value again (idempotent)
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: stp_enable
|
2018-08-10 05:01:03 +00:00
|
|
|
value: 'true'
|
|
|
|
become: yes
|
2018-08-08 14:01:42 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
|
|
|
|
|
|
|
- name: Try to set value on a map type without a key (negative)
|
|
|
|
ignore_errors: true
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
value: true
|
2018-08-10 05:01:03 +00:00
|
|
|
become: yes
|
2018-08-08 14:01:42 +00:00
|
|
|
register: result
|
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.failed == true"
|
|
|
|
|
2017-06-12 15:41:10 +00:00
|
|
|
- name: Remove bridge
|
|
|
|
openvswitch_db:
|
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
|
|
|
state: absent
|
2017-06-12 15:48:59 +00:00
|
|
|
register: result
|
2017-06-12 15:41:10 +00:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == true"
|
|
|
|
|
|
|
|
- name: Remove bridge again (idempotent)
|
|
|
|
openvswitch_db:
|
2017-06-12 11:13:41 +00:00
|
|
|
table: Bridge
|
|
|
|
record: br-test
|
|
|
|
col: other_config
|
|
|
|
key: disable-in-band
|
|
|
|
value: false
|
|
|
|
state: absent
|
2017-06-12 15:48:59 +00:00
|
|
|
register: result
|
2017-06-12 15:41:10 +00:00
|
|
|
|
|
|
|
- assert:
|
|
|
|
that:
|
|
|
|
- "result.changed == false"
|
2017-11-21 12:34:27 +00:00
|
|
|
|
|
|
|
- name: Tear down test bridge
|
|
|
|
command: ovs-vsctl del-br br-test
|