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:
Daniel Mellado Area
2019-06-05 16:32:15 +02:00
committed by Sam Doran
parent 72f2d05b6f
commit 091bebcbf7
3 changed files with 61 additions and 4 deletions

View File

@@ -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