@ -30,8 +30,8 @@ extends_documentation_fragment: openstack
author : " Davide Agnello (@dagnello) "
author : " Davide Agnello (@dagnello) "
version_added : " 2.0 "
version_added : " 2.0 "
description :
description :
- Add , Update or Remove ports from an OpenStack cloud . A state = present ,
- Add , Update or Remove ports from an OpenStack cloud . A I ( state ) of
will ensure the port is created or updated if required .
' present ' will ensure the port is created or updated if required .
options :
options :
network :
network :
description :
description :
@ -79,11 +79,11 @@ options:
- ip_address : . . . "
- ip_address : . . . "
required : false
required : false
default : None
default : None
extra_dhcp_opt :
extra_dhcp_opt s :
description :
description :
- " Extra dhcp options to be assigned to this port. Extra options are
- " Extra dhcp options to be assigned to this port. Extra options are
supported with dictionary structure .
supported with dictionary structure .
e . g . extra_dhcp_opt :
e . g . extra_dhcp_opt s :
- opt_name : opt name1
- opt_name : opt name1
opt_value : value1
opt_value : value1
- opt_name : . . . "
- opt_name : . . . "
@ -218,7 +218,7 @@ def _needs_update(module, port, cloud):
' device_owner ' ,
' device_owner ' ,
' device_id ' ]
' device_id ' ]
compare_dict = [ ' allowed_address_pairs ' ,
compare_dict = [ ' allowed_address_pairs ' ,
' extra_dhcp_opt ' ]
' extra_dhcp_opt s ' ]
compare_list = [ ' security_groups ' ]
compare_list = [ ' security_groups ' ]
for key in compare_simple :
for key in compare_simple :
@ -280,7 +280,7 @@ def _compose_port_args(module, cloud):
' mac_address ' ,
' mac_address ' ,
' security_groups ' ,
' security_groups ' ,
' allowed_address_pairs ' ,
' allowed_address_pairs ' ,
' extra_dhcp_opt ' ,
' extra_dhcp_opt s ' ,
' device_owner ' ,
' device_owner ' ,
' device_id ' ]
' device_id ' ]
for optional_param in optional_parameters :
for optional_param in optional_parameters :
@ -310,8 +310,8 @@ def main():
mac_address = dict ( default = None ) ,
mac_address = dict ( default = None ) ,
security_groups = dict ( default = None , type = ' list ' ) ,
security_groups = dict ( default = None , type = ' list ' ) ,
no_security_groups = dict ( default = False , type = ' bool ' ) ,
no_security_groups = dict ( default = False , type = ' bool ' ) ,
allowed_address_pairs = dict ( type = ' dic t' , default = None ) ,
allowed_address_pairs = dict ( type = ' lis t' , default = None ) ,
extra_dhcp_opt = dict ( type = ' dic t' , default = None ) ,
extra_dhcp_opt s = dict ( type = ' lis t' , default = None ) ,
device_owner = dict ( default = None ) ,
device_owner = dict ( default = None ) ,
device_id = dict ( default = None ) ,
device_id = dict ( default = None ) ,
state = dict ( default = ' present ' , choices = [ ' absent ' , ' present ' ] ) ,
state = dict ( default = ' present ' , choices = [ ' absent ' , ' present ' ] ) ,