mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Add support for vlan update on ovs bridges (#57168)
This commit adds support for vlan update on openvswitch_bridge module.
This commit is contained in:
committed by
Sam Doran
parent
72f2d05b6f
commit
091bebcbf7
@@ -140,6 +140,12 @@ def map_obj_to_commands(want, have, module):
|
||||
or want['external_ids'][k] != have['external_ids'][k]):
|
||||
command += " " + k + " " + v
|
||||
commands.append(command)
|
||||
|
||||
if want['vlan'] and want['vlan'] != have['vlan']:
|
||||
templatized_command = ("%(ovs-vsctl)s -t %(timeout)s"
|
||||
" set port %(bridge)s tag=%(vlan)s")
|
||||
command = templatized_command % module.params
|
||||
commands.append(command)
|
||||
else:
|
||||
templatized_command = ("%(ovs-vsctl)s -t %(timeout)s add-br"
|
||||
" %(bridge)s")
|
||||
@@ -169,6 +175,7 @@ def map_obj_to_commands(want, have, module):
|
||||
command = templatized_command % module.params
|
||||
command += " " + k + " " + v
|
||||
commands.append(command)
|
||||
|
||||
return commands
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user