diff --git a/lib/ansible/modules/network/aci/aci_access_port_block_to_access_port.py b/lib/ansible/modules/network/aci/aci_access_port_block_to_access_port.py index d52efeae75..052ef4827e 100644 --- a/lib/ansible/modules/network/aci/aci_access_port_block_to_access_port.py +++ b/lib/ansible/modules/network/aci/aci_access_port_block_to_access_port.py @@ -39,6 +39,9 @@ options: - The name of the Fabric access policy leaf interface profile access port block. required: yes aliases: [ leaf_port_blk_name ] + leaf_port_blk_description: + description: + - The description to assign to the C(leaf_port_blk) from_port: description: - The beginning (from-range) of the port range block for the leaf access port block. @@ -253,6 +256,7 @@ def main(): leaf_interface_profile=dict(type='str', aliases=['leaf_interface_profile_name']), # Not required for querying all objects access_port_selector=dict(type='str', aliases=['name', 'access_port_selector_name']), # Not required for querying all objects leaf_port_blk=dict(type='str', aliases=['leaf_port_blk_name']), # Not required for querying all objects + leaf_port_blk_description=dict(type='str'), from_port=dict(type='str', aliases=['from', 'fromPort', 'from_port_range']), # Not required for querying all objects and deleting port blocks to_port=dict(type='str', aliases=['to', 'toPort', 'to_port_range']), # Not required for querying all objects and deleting port blocks from_card=dict(type='str', aliases=['from_card_range']), @@ -272,6 +276,7 @@ def main(): leaf_interface_profile = module.params['leaf_interface_profile'] access_port_selector = module.params['access_port_selector'] leaf_port_blk = module.params['leaf_port_blk'] + leaf_port_blk_description = module.params['leaf_port_blk_description'] from_port = module.params['from_port'] to_port = module.params['to_port'] from_card = module.params['from_card'] @@ -307,6 +312,7 @@ def main(): aci.payload( aci_class='infraPortBlk', class_config=dict( + descr=leaf_port_blk_description, name=leaf_port_blk, fromPort=from_port, toPort=to_port, diff --git a/test/integration/targets/aci_access_port_block_to_access_port/tasks/main.yml b/test/integration/targets/aci_access_port_block_to_access_port/tasks/main.yml index 2d4a72902d..6045b01010 100644 --- a/test/integration/targets/aci_access_port_block_to_access_port/tasks/main.yml +++ b/test/integration/targets/aci_access_port_block_to_access_port/tasks/main.yml @@ -32,6 +32,7 @@ aci_access_port_block_to_access_port: &aci_access_port_block_to_access_port_present <<: *aci_access_port_to_interface_policy_leaf_profile_present leaf_port_blk: anstest_leafportblkname + leaf_port_blk_description: anstest_leafportblkdesc fromPort: 13 toPort: 16 check_mode: yes @@ -62,15 +63,13 @@ - accessportblock_to_accessport_check_mode_present is changed - accessportblock_to_accessport_present is changed - accessportblock_to_accessport_present.previous == [] - - 'accessportblock_to_accessport_present.sent == {"infraPortBlk": {"attributes": {"name": "anstest_leafportblkname", "fromPort": "16", "toPort": "16"}}}' + - 'accessportblock_to_accessport_present.sent == {"infraPortBlk": {"attributes": {"descr": "anstest_leafportblkdesc", "name": "anstest_leafportblkname", "fromPort": "16", "toPort": "16"}}}' - accessportblock_to_accessport_idempotent is not changed - accessportblock_to_accessport_idempotent.sent == {} - accessportblock_to_accessport_update is changed - 'accessportblock_to_accessport_update.sent == {"infraPortBlk": {"attributes": {"name": "anstest_leafportblkname", "fromPort": "15", "toPort": "15"}}}' -# TODO FROM HERE - - name: Query Specific port block and access_port_selector binding aci_access_port_block_to_access_port: <<: *aci_access_port_block_to_access_port_present @@ -105,8 +104,6 @@ aci_access_port_block_to_access_port: <<: *aci_access_port_to_interface_policy_leaf_profile_present #leaf_port_blk: anstest_leafportblkname - #fromPort: 13 - #toPort: 16 state: absent ignore_errors: yes register: accessportblock_to_accessport_absent_missing_param @@ -121,7 +118,7 @@ - accessportblock_to_accessport_absent_idempotent is not changed - accessportblock_to_accessport_absent_idempotent.previous == [] - accessportblock_to_accessport_absent_missing_param is failed - - 'accessportblock_to_accessport_absent_missing_param.msg == "state is absent but all of the following are missing: leaf_port_blk, fromPort, toPort"' + - 'accessportblock_to_accessport_absent_missing_param.msg == "state is absent but all of the following are missing: leaf_port_blk"' - name: Remove binding of Access Port Block and Interface Access Port Selector - Clean up