mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-05-08 02:01:31 -07:00
openvswitch_db: Make 'key' parameter optional (#42110)
The OVSDB schema consists of typed columns. The 'key' parameter is required only for columns with type of a 'map'. This patch makes 'key' an optional parameter to allow setting values for other column types like int. Fixes #42108
This commit is contained in:
parent
e9c7b513a1
commit
26b0908270
3 changed files with 106 additions and 11 deletions
|
@ -33,7 +33,7 @@
|
|||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- name: Change column value
|
||||
- name: Change column value in a map
|
||||
openvswitch_db:
|
||||
table: Bridge
|
||||
record: br-test
|
||||
|
@ -46,7 +46,7 @@
|
|||
that:
|
||||
- "result.changed == true"
|
||||
|
||||
- name: Change column value again (idempotent)
|
||||
- name: Change column value in a map again (idempotent)
|
||||
openvswitch_db:
|
||||
table: Bridge
|
||||
record: br-test
|
||||
|
@ -59,6 +59,43 @@
|
|||
that:
|
||||
- "result.changed == false"
|
||||
|
||||
- name: Change column value
|
||||
openvswitch_db:
|
||||
table: Bridge
|
||||
record: br-test
|
||||
col: stp_enable
|
||||
value: true
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.changed == true"
|
||||
|
||||
- name: Change column value again (idempotent)
|
||||
openvswitch_db:
|
||||
table: Bridge
|
||||
record: br-test
|
||||
col: stp_enable
|
||||
value: true
|
||||
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
|
||||
register: result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "result.failed == true"
|
||||
|
||||
- name: Remove bridge
|
||||
openvswitch_db:
|
||||
table: Bridge
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue