@ -45,7 +45,8 @@ options:
required : true
interfaces :
description :
- List of interfaces that should be associated to the VLAN .
- List of interfaces that should be associated to the VLAN . The name of interface
should be in expanded format and not abbreviated .
delay :
description :
- Delay the play should wait to check for declarative intent params values .
@ -214,7 +215,7 @@ def map_config_to_obj(module):
if len ( splitted_line ) > 3 :
for i in splitted_line [ 3 ] . split ( ' , ' ) :
obj [ ' interfaces ' ] . append ( i . strip ( ) . replace ( ' Et ' , ' E thernet' ) )
obj [ ' interfaces ' ] . append ( i . strip ( ) . replace ( ' Et ' , ' e thernet' ) )
objs . append ( obj )
@ -230,6 +231,9 @@ def map_params_to_obj(module):
if item . get ( key ) is None :
item [ key ] = module . params [ key ]
if item . get ( ' interfaces ' ) :
item [ ' interfaces ' ] = [ intf . replace ( " " , " " ) . lower ( ) for intf in item . get ( ' interfaces ' ) if intf ]
d = item . copy ( )
d [ ' vlan_id ' ] = str ( d [ ' vlan_id ' ] )
@ -239,7 +243,7 @@ def map_params_to_obj(module):
' vlan_id ' : str ( module . params [ ' vlan_id ' ] ) ,
' name ' : module . params [ ' name ' ] ,
' state ' : module . params [ ' state ' ] ,
' interfaces ' : module . params [ ' interfaces ' ]
' interfaces ' : [ intf . replace ( " " , " " ) . lower ( ) for intf in module . params [ ' interfaces ' ] ] if module . params [ ' interfaces ' ] else [ ]
} )
return obj
@ -318,5 +322,6 @@ def main():
module . exit_json ( * * result )
if __name__ == ' __main__ ' :
main ( )