From adc5300d6d18861e23e6207cd91167f5bf7578ce Mon Sep 17 00:00:00 2001 From: Allen Robel Date: Tue, 3 May 2022 10:42:54 -1000 Subject: [PATCH] task name consistency --- .../tasks/main.yml | 6 ++++-- roles/ndfc_device_deleted/tasks/main.yml | 2 +- roles/ndfc_device_deleted/tasks/worker.yml | 6 +++--- roles/ndfc_device_deleted_all/tasks/main.yml | 2 +- .../tasks/main.yml | 6 +++--- roles/ndfc_device_merged/tasks/main.yml | 2 +- roles/ndfc_device_merged/tasks/worker.yml | 6 +++--- roles/ndfc_device_merged_all/tasks/main.yml | 6 +++--- roles/ndfc_device_merged_all/tasks/worker.yml | 6 +++--- roles/ndfc_device_query/tasks/main.yml | 2 +- roles/ndfc_device_query/tasks/worker.yml | 6 +++--- roles/ndfc_device_query_all/tasks/main.yml | 2 +- roles/ndfc_device_query_all/tasks/worker.yml | 4 ++-- .../tasks/main.yml | 2 +- .../tasks/worker.yml | 6 +++--- roles/ndfc_fabric_create_rest/tasks/main.yml | 8 ++++---- roles/ndfc_fabric_delete_rest/tasks/main.yml | 8 ++++---- roles/ndfc_network_deleted_all/tasks/main.yml | 2 +- .../ndfc_network_deleted_all/tasks/worker.yml | 2 +- .../ndfc_network_replaced_all/tasks/main.yml | 2 +- .../tasks/worker.yml | 2 +- .../tasks/main.yml | 6 +++--- .../tasks/worker.yml | 4 ++-- .../tasks/main.yml | 6 +++--- .../tasks/worker.yml | 6 +++--- .../ndfc_policy_vrf_rt_import/tasks/main.yml | 2 +- .../tasks/worker.yml | 2 +- .../tasks/main.yml | 2 +- .../tasks/worker.yml | 2 +- roles/ndfc_vpc_create_rest/tasks/main.yml | 10 +++++----- roles/ndfc_vpc_delete_rest/tasks/main.yml | 20 ++++++------------- .../tasks/main.yml | 2 +- .../tasks/worker.yml | 14 ++++++------- roles/ndfc_vrf_all/tasks/main.yml | 2 +- roles/ndfc_vrf_all/tasks/worker.yml | 2 +- .../tasks/main.yml | 2 +- roles/ndfc_vrf_query/tasks/main.yml | 2 +- roles/ndfc_vrf_query/tasks/worker.yml | 2 +- roles/ndfc_vrf_replaced/tasks/main.yml | 2 +- roles/ndfc_vrf_replaced/tasks/worker.yml | 2 +- 40 files changed, 85 insertions(+), 93 deletions(-) diff --git a/roles/ndfc_config_deploy_all_rest/tasks/main.yml b/roles/ndfc_config_deploy_all_rest/tasks/main.yml index 6512b68..847ae0a 100644 --- a/roles/ndfc_config_deploy_all_rest/tasks/main.yml +++ b/roles/ndfc_config_deploy_all_rest/tasks/main.yml @@ -1,6 +1,7 @@ # ndfc_config_deploy_all_rest/tasks/main.yml --- -- cisco.dcnm.dcnm_rest: +- name: main REST POST config-save FABRIC {{ fabric_name }} + cisco.dcnm.dcnm_rest: method: POST path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{{ fabric_name }}/config-save" json_data: "{{ vars_dict | to_json }}" @@ -8,7 +9,8 @@ vars_dict: forceShowRun: "{{ forceShowRun }}" inclAllMSDSwitches: "{{ inclAllMSDSwitches }}" -- cisco.dcnm.dcnm_rest: +- name: main REST POST config-deploy FABRIC {{ fabric_name }} + cisco.dcnm.dcnm_rest: method: POST path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{{ fabric_name }}/config-deploy" json_data: "{{ vars_dict | to_json }}" diff --git a/roles/ndfc_device_deleted/tasks/main.yml b/roles/ndfc_device_deleted/tasks/main.yml index 8f5fa37..326221a 100644 --- a/roles/ndfc_device_deleted/tasks/main.yml +++ b/roles/ndfc_device_deleted/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_device_deleted/tasks/main.yml --- -- name: ndfc_device_deleted +- name: main deleted FABRIC {{ fabric_name }} DEVICE {{ device_name }} include_tasks: worker.yml loop: "{{ r1 }}" vars: diff --git a/roles/ndfc_device_deleted/tasks/worker.yml b/roles/ndfc_device_deleted/tasks/worker.yml index 17e0090..7fc0bd7 100644 --- a/roles/ndfc_device_deleted/tasks/worker.yml +++ b/roles/ndfc_device_deleted/tasks/worker.yml @@ -1,6 +1,6 @@ --- # ndfc_device_deleted/tasks/worker.yml -- name: "query {{ item.ip }}" +- name: worker query FABRIC {{ item.fabric }} NAME {{ item.name }} IP {{ item.ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ fabric_name }}" state: query @@ -8,13 +8,13 @@ - seed_ip: "{{ item.ip }}" register: result -- name: set_fact serial +- name: worker set_fact serial set_fact: serial: "{{ result.response | json_query(q2) }}" vars: q2: "[0].serialNumber" -- name: deleted {{ item.fabric }} {{ item.role }} {{ item.name }} {{ item.ip}} serial ({{ serial }}) +- name: worker deleted FABRIC {{ item.fabric }} NAME {{ item.name }} IP {{ item.ip}} SERIAL ({{ serial }}) cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: deleted diff --git a/roles/ndfc_device_deleted_all/tasks/main.yml b/roles/ndfc_device_deleted_all/tasks/main.yml index 8d02428..876256e 100644 --- a/roles/ndfc_device_deleted_all/tasks/main.yml +++ b/roles/ndfc_device_deleted_all/tasks/main.yml @@ -1,5 +1,5 @@ # ndfc_device_deleted_all/tasks/main.yml -- name: Delete all devices in fabric fabric_name +- name: main deleted FABRIC {{ fabric_name }} all devices cisco.dcnm.dcnm_inventory: fabric: "{{ fabric_name }}" state: deleted diff --git a/roles/ndfc_device_list_by_fabric_rest/tasks/main.yml b/roles/ndfc_device_list_by_fabric_rest/tasks/main.yml index 4ad1940..243e3f2 100644 --- a/roles/ndfc_device_list_by_fabric_rest/tasks/main.yml +++ b/roles/ndfc_device_list_by_fabric_rest/tasks/main.yml @@ -3,18 +3,18 @@ # Return JSON object 'info' which will be a list of switch dictionaries # if the GET request is successful, or an empty list if the GET request fails --- -- name: Retrieve list of devices in fabric {{ fabric_name }} +- name: main REST GET FABRIC {{ fabric_name }} switchesByFabric cisco.dcnm.dcnm_rest: method: GET path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{{ fabric_name }}/inventory/switchesByFabric" register: result ignore_errors: true -- name: set_fact info on success +- name: main set_fact info SUCCESS set_fact: info: "{{ result.response.DATA }}" when: result is succeeded -- name: set_fact info on failed +- name: main set_fact info FAILED set_fact: info: "{{ [] | to_json }}" when: diff --git a/roles/ndfc_device_merged/tasks/main.yml b/roles/ndfc_device_merged/tasks/main.yml index 0bf4f52..ece98c6 100644 --- a/roles/ndfc_device_merged/tasks/main.yml +++ b/roles/ndfc_device_merged/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_device_merged/tasks/main.yml --- -- name: ndfc_device_merged +- name: main merged FABRIC {{ fabric_name }} DEVICE {{ device_name }} include_tasks: worker.yml loop: "{{ r1 }}" vars: diff --git a/roles/ndfc_device_merged/tasks/worker.yml b/roles/ndfc_device_merged/tasks/worker.yml index ace4e7e..2efb69f 100644 --- a/roles/ndfc_device_merged/tasks/worker.yml +++ b/roles/ndfc_device_merged/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_device_merged/tasks/worker.yml -- name: "query {{ item.fabric }} {{ item.name }} {{ item.ip }}" +- name: worker query FABRIC {{ item.fabric }} NAME {{ item.name }} IP {{ item.ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: query @@ -9,13 +9,13 @@ # serial is used below to skip device creation if the # device already exists -- name: set_fact device serial number +- name: worker set_fact device serial number set_fact: serial: "{{ result.response | json_query(q2) }}" vars: q2: "[0].serialNumber" -- name: "merged {{ fabric_name }} {{ item.name }} serial ({{ serial }})" +- name: worker merged FABRIC {{ item.fabric }} NAME {{ item.name }} IP {{ item.ip }} SERIAL ({{ serial }}) cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: merged diff --git a/roles/ndfc_device_merged_all/tasks/main.yml b/roles/ndfc_device_merged_all/tasks/main.yml index 5f0d6c2..364bca3 100644 --- a/roles/ndfc_device_merged_all/tasks/main.yml +++ b/roles/ndfc_device_merged_all/tasks/main.yml @@ -1,16 +1,16 @@ # ndfc_device_merged_all/tasks/main.yml --- -- name: Update / Add Leafs +- name: main merged leaf FABRIC {{ fabric_name }} include_tasks: worker.yml loop: "{{ leafs | json_query(query) }}" vars: query: "[?fabric == '{{ fabric_name }}']" -- name: Update / Add Spines +- name: main merged spine FABRIC {{ fabric_name }} include_tasks: worker.yml loop: "{{ spines | json_query(query) }}" vars: query: "[?fabric == '{{ fabric_name }}']" -- name: Update / Add Border Gateways +- name: main merged border_gateway FABRIC {{ fabric_name }} include_tasks: worker.yml loop: "{{ border_gateways | json_query(query) }}" vars: diff --git a/roles/ndfc_device_merged_all/tasks/worker.yml b/roles/ndfc_device_merged_all/tasks/worker.yml index 5eb3ab2..433813d 100644 --- a/roles/ndfc_device_merged_all/tasks/worker.yml +++ b/roles/ndfc_device_merged_all/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_device_merged_all/tasks/worker.yml -- name: "query {{ item.fabric }} {{ item.name }} {{ item.ip }}" +- name: worker query FABRIC {{ item.fabric }} NAME {{ item.name }} IP {{ item.ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: query @@ -8,13 +8,13 @@ register: result # Use serialNumber to determine if device already exists -- name: set_fact device serial number +- name: worker set_fact device serial number set_fact: serial: "{{ result.response | json_query(q2) }}" vars: q2: "[0].serialNumber" -- name: "merged {{ fabric_name }} {{ item.name }} serial ({{ serial }})" +- name: worker merged FABRIC {{ item.fabric }} NAME {{ item.name }} SERIAL {{ serial }} IP {{ item.ip }} MAX_HOPS {{ max_hops }} AUTH_PROTO {{ auth_proto }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: merged diff --git a/roles/ndfc_device_query/tasks/main.yml b/roles/ndfc_device_query/tasks/main.yml index 1bcfce5..ca53ef1 100644 --- a/roles/ndfc_device_query/tasks/main.yml +++ b/roles/ndfc_device_query/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_device_query/tasks/main.yml --- -- name: "query {{ fabric_name }} {{ device_name }}" +- name: main query FABRIC {{ fabric_name }} DEVICE {{ device_name }} include_tasks: worker.yml loop: "{{ r1 }}" vars: diff --git a/roles/ndfc_device_query/tasks/worker.yml b/roles/ndfc_device_query/tasks/worker.yml index dc78a9b..cd45ef0 100644 --- a/roles/ndfc_device_query/tasks/worker.yml +++ b/roles/ndfc_device_query/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_device_query/tasks/worker.yml -- name: "{{ item.fabric }} {{ item.name }} {{ item.ip }}" +- name: worker query FABRIC {{ item.fabric }} NAME {{ item.name }} IP {{ item.ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: query @@ -8,14 +8,14 @@ register: result # playbooks can cull information from device_info -- name: set_fact device_info +- name: worker set_fact device_info set_fact: device_info: "{{ result.response | json_query(q2) }}" vars: q2: "[0]" # used in playbooks to skip the query if serial is not defined -- name: set_fact serial +- name: worker set_fact serial set_fact: serial: "{{ result.response | json_query(q3) }}" vars: diff --git a/roles/ndfc_device_query_all/tasks/main.yml b/roles/ndfc_device_query_all/tasks/main.yml index 06653bb..f82013d 100644 --- a/roles/ndfc_device_query_all/tasks/main.yml +++ b/roles/ndfc_device_query_all/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_device_query_all/tasks/main.yml --- -- name: "query {{ fabric_name }}" +- name: main query FABRIC {{ fabric_name }} include_tasks: worker.yml loop: "{{ r1 }}" vars: diff --git a/roles/ndfc_device_query_all/tasks/worker.yml b/roles/ndfc_device_query_all/tasks/worker.yml index 8a4b8c1..850e7a1 100644 --- a/roles/ndfc_device_query_all/tasks/worker.yml +++ b/roles/ndfc_device_query_all/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_device_query_all/tasks/worker.yml -- name: "{{ item.fabric }} {{ item.name }} {{ item.ip }}" +- name: worker query FABRIC {{ item.fabric }} NAME {{ item.name }} IP {{ item.ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: query @@ -7,7 +7,7 @@ - seed_ip: "{{ item.ip }}" register: result -- name: set_fact serial +- name: worker set_fact serial set_fact: serial: "{{ result.response | json_query(q2) }}" vars: diff --git a/roles/ndfc_device_rediscover_rest/tasks/main.yml b/roles/ndfc_device_rediscover_rest/tasks/main.yml index b373136..c728777 100644 --- a/roles/ndfc_device_rediscover_rest/tasks/main.yml +++ b/roles/ndfc_device_rediscover_rest/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_device_rediscover_rest/tasks/main.yml --- -- name: "query {{ fabric_name }} {{ device_name }}" +- name: main query FABRIC {{ fabric_name }} DEVICE {{ device_name }} include_tasks: worker.yml loop: "{{ r1 }}" vars: diff --git a/roles/ndfc_device_rediscover_rest/tasks/worker.yml b/roles/ndfc_device_rediscover_rest/tasks/worker.yml index 8f8d0dd..f93780d 100644 --- a/roles/ndfc_device_rediscover_rest/tasks/worker.yml +++ b/roles/ndfc_device_rediscover_rest/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_device_rediscover_rest/tasks/worker.yml -- name: "query {{ item.fabric }} {{ item.role }} {{ item.name }} {{ item.ip }}" +- name: worker query FABRIC {{ item.fabric }} ROLE {{ item.role }} NAME {{ item.name }} IP {{ item.ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: query @@ -7,13 +7,13 @@ - seed_ip: "{{ item.ip }}" register: result -- name: "set_fact device_id - {{ item.fabric }} {{ item.role }} {{ item.name }} {{ item.ip }}" +- name: worker set_fact device_id FABRIC {{ item.fabric }} ROLE {{ item.role }} NAME {{ item.name }} IP {{ item.ip }} set_fact: device_id: "{{ result.response | json_query(q2) | to_json }}" vars: q2: "[0].switchDbID" -- name: "Rediscover Device {{ item.fabric }} {{ item.role }} {{ item.name }} {{ item.ip }} {{ device_id }}" +- name: worker REST POST rediscoverSwitch FABRIC {{ item.fabric }} ROLE {{ item.role }} NAME {{ item.name }} IP {{ item.ip }} DEVICE_ID {{ device_id }} cisco.dcnm.dcnm_rest: method: POST path: "/appcenter/cisco/ndfc/api/v1/lan-discovery/rediscoverSwitch" diff --git a/roles/ndfc_fabric_create_rest/tasks/main.yml b/roles/ndfc_fabric_create_rest/tasks/main.yml index fd4050f..b13827a 100644 --- a/roles/ndfc_fabric_create_rest/tasks/main.yml +++ b/roles/ndfc_fabric_create_rest/tasks/main.yml @@ -1,16 +1,16 @@ # ndfc_fabric_create_rest/tasks/main.yml --- -- name: Retrieve list of fabrics +- name: main REST GET fabrics cisco.dcnm.dcnm_rest: method: GET path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics" register: result -- name: set_fact active_fabrics +- name: main set_fact active_fabrics set_fact: active_fabrics: "{{ result.response.DATA | json_query(query) | to_json }}" vars: query: "[*].{FabricName: fabricName}" -- name: set_fact for fabric +- name: main set_fact FABRIC {{ fabric_name }} set_fact: BGP_AS: "{{ fabrics | json_query(q1) }}" ANYCAST_RP_IP_RANGE: "{{ fabrics | json_query(q2) }}" @@ -28,7 +28,7 @@ q6: "[?name == '{{ fabric_name }}'].FABRIC_MTU | [0]" q7: "[?name == '{{ fabric_name }}'].REPLICATION_MODE | [0]" -- name: Easy_Fabric {{ fabric_name }} BGP_AS {{ BGP_AS }} ACTIVE_FABRICS {{ active_fabrics }} +- name: main REST POST Easy_Fabric FABRIC {{ fabric_name }} BGP_AS {{ BGP_AS }} ACTIVE_FABRICS {{ active_fabrics }} cisco.dcnm.dcnm_rest: method: POST path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{{ fabric_name }}/Easy_Fabric" diff --git a/roles/ndfc_fabric_delete_rest/tasks/main.yml b/roles/ndfc_fabric_delete_rest/tasks/main.yml index 17d4623..d86bae2 100644 --- a/roles/ndfc_fabric_delete_rest/tasks/main.yml +++ b/roles/ndfc_fabric_delete_rest/tasks/main.yml @@ -1,22 +1,22 @@ # ndfc_fabric_delete_rest/tasks/main.yml --- -- name: Retrieve list of fabrics +- name: main REST GET fabrics cisco.dcnm.dcnm_rest: method: GET path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics" register: result -- name: set_fact active_fabrics +- name: main set_fact active_fabrics set_fact: active_fabrics: "{{ result.response.DATA | json_query(query) | to_json }}" vars: query: "[*].{FabricName: fabricName}" -- name: set_fact asn +- name: main set_fact asn set_fact: asn: "{{ fabrics | json_query(query) }}" vars: query: "[?name == '{{ fabric_name }}'].asn | [0]" -- name: Fabric DELETE {{ fabric_name }} from ACTIVE_FABRICS {{ active_fabrics }} +- name: main REST DELETE FABRIC {{ fabric_name }} from ACTIVE_FABRICS {{ active_fabrics }} cisco.dcnm.dcnm_rest: method: DELETE path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/control/fabrics/{{ fabric_name }}" diff --git a/roles/ndfc_network_deleted_all/tasks/main.yml b/roles/ndfc_network_deleted_all/tasks/main.yml index a83ce51..c795292 100644 --- a/roles/ndfc_network_deleted_all/tasks/main.yml +++ b/roles/ndfc_network_deleted_all/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_network_deleted_all/tasks/main.yml --- -- name: delete all networks in fabric {{ fabric_name }} +- name: main deleted FABRIC {{ fabric_name }} networks include_tasks: worker.yml loop: "{{ networks | json_query(q1) }}" vars: diff --git a/roles/ndfc_network_deleted_all/tasks/worker.yml b/roles/ndfc_network_deleted_all/tasks/worker.yml index 4fb8957..75c7893 100644 --- a/roles/ndfc_network_deleted_all/tasks/worker.yml +++ b/roles/ndfc_network_deleted_all/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_network_deleted_all/tasks/worker.yml -- name: "deleted FABRIC {{ fabric_name }} NETWORK {{ item.net_name }} VRF {{ item.vrf_name }} VLAN {{ item.vlan_id }} SUBNET {{ item.gw_ip_subnet }}" +- name: worker deleted FABRIC {{ fabric_name }} NETWORK {{ item.net_name }} VRF {{ item.vrf_name }} VLAN {{ item.vlan_id }} SUBNET {{ item.gw_ip_subnet }} cisco.dcnm.dcnm_network: fabric: "{{ fabric_name }}" state: deleted diff --git a/roles/ndfc_network_replaced_all/tasks/main.yml b/roles/ndfc_network_replaced_all/tasks/main.yml index 16b7386..d965d7d 100644 --- a/roles/ndfc_network_replaced_all/tasks/main.yml +++ b/roles/ndfc_network_replaced_all/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_network_replaced_all/tasks/main.yml --- -- name: Update Network (replaced) +- name: main replaced Network FABRIC {{ fabric_name }} include_tasks: worker.yml loop: "{{ networks | json_query(q1) }}" vars: diff --git a/roles/ndfc_network_replaced_all/tasks/worker.yml b/roles/ndfc_network_replaced_all/tasks/worker.yml index 8c519c3..c9b25fa 100644 --- a/roles/ndfc_network_replaced_all/tasks/worker.yml +++ b/roles/ndfc_network_replaced_all/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_network_replaced_all/tasks/worker.yml -- name: "{{ state }} FABRIC {{ fabric_name }} NETWORK {{ item.net_name }} VRF {{ item.vrf_name }} VLAN {{ item.vlan_id }} SUBNET {{ item.gw_ip_subnet }}" +- name: worker replaced FABRIC {{ fabric_name }} NETWORK {{ item.net_name }} VRF {{ item.vrf_name }} VLAN {{ item.vlan_id }} SUBNET {{ item.gw_ip_subnet }}" cisco.dcnm.dcnm_network: fabric: "{{ fabric_name }}" state: replaced diff --git a/roles/ndfc_policy_query_generated_config_all/tasks/main.yml b/roles/ndfc_policy_query_generated_config_all/tasks/main.yml index 8e5a45e..19a00a2 100644 --- a/roles/ndfc_policy_query_generated_config_all/tasks/main.yml +++ b/roles/ndfc_policy_query_generated_config_all/tasks/main.yml @@ -1,16 +1,16 @@ # ndfc_policy_query_generated_config_all/main.yml --- -- name: Query Leaf Generated Configs +- name: main query FABRIC {{ fabric_name }} Generated Configs leaf include_tasks: worker.yml loop: "{{ leafs | json_query(q1) }}" vars: q1: "[?fabric == '{{ fabric_name }}']" -- name: Query Spine Generated Configs +- name: main query FABRIC {{ fabric_name }} Generated Configs spine include_tasks: worker.yml loop: "{{ spines | json_query(q1) }}" vars: q1: "[?fabric == '{{ fabric_name }}']" -- name: Query Border Gateway Generated Configs +- name: main query FABRIC {{ fabric_name }} Generated Configs border_gateway include_tasks: worker.yml loop: "{{ border_gateways | json_query(q1) }}" vars: diff --git a/roles/ndfc_policy_query_generated_config_all/tasks/worker.yml b/roles/ndfc_policy_query_generated_config_all/tasks/worker.yml index 5c7d683..55e7fca 100644 --- a/roles/ndfc_policy_query_generated_config_all/tasks/worker.yml +++ b/roles/ndfc_policy_query_generated_config_all/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_policy_query_generated_config_all/worker.yml -- name: "dcnm_policy query generated_config {{ item.name }} {{ item.ip }}" +- name: worker query FABRIC {{ fabric_name }} DEVICE {{ item.name }} IP {{ item.ip }} generated_config cisco.dcnm.dcnm_policy: fabric: "{{ fabric_name }}" state: query @@ -8,7 +8,7 @@ - ip: "{{ item.ip }}" register: result -- name: set_fact {{ item.name }} {{ item.ip }} +- name: worker set_fact DEVICE {{ item.name }} IP {{ item.ip }} set_fact: generated_configs: "{{ result.response | json_query(q2) }}" vars: diff --git a/roles/ndfc_policy_query_interface_all/tasks/main.yml b/roles/ndfc_policy_query_interface_all/tasks/main.yml index 028ce87..07cd3e0 100644 --- a/roles/ndfc_policy_query_interface_all/tasks/main.yml +++ b/roles/ndfc_policy_query_interface_all/tasks/main.yml @@ -1,18 +1,18 @@ # ndfc_policy_query_interface/tasks/main.yml --- -- name: Query Leaf Interface Policies +- name: main query FABRIC {{ fabric_name }} Interface Policies leaf include_tasks: worker.yml loop: "{{ leafs | json_query(qm1) }}" vars: qm1: "[?fabric == '{{ fabric_name }}']" -- name: Query Spine Interface Policies +- name: main query FABRIC {{ fabric_name }} Interface Policies spine include_tasks: worker.yml loop: "{{ spines | json_query(qm2) }}" vars: qm2: "[?fabric == '{{ fabric_name }}']" -- name: Query Border Gateway Interface Policies +- name: main query FABRIC {{ fabric_name }} Interface Policies border_gateway include_tasks: worker.yml loop: "{{ border_gateways | json_query(qm3) }}" vars: diff --git a/roles/ndfc_policy_query_interface_all/tasks/worker.yml b/roles/ndfc_policy_query_interface_all/tasks/worker.yml index efea0c1..1fcbecf 100644 --- a/roles/ndfc_policy_query_interface_all/tasks/worker.yml +++ b/roles/ndfc_policy_query_interface_all/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_policy_query_interface/tasks/worker.yml -- name: "dcnm_policy {{ fabric_name }} {{ item.role}} {{ item.name }} {{ interface_name }}" +- name: worker query FABRIC {{ fabric_name }} ROLE {{ item.role}} DEVICE {{ item.name }} INTERFACE {{ interface_name }}" cisco.dcnm.dcnm_policy: fabric: "{{ fabric_name }}" state: query @@ -8,12 +8,12 @@ - ip: "{{ item.ip }}" register: result -- name: set_fact interface_config +- name: worker set_fact interface_config set_fact: interface_config: "{{ result.response | json_query(qw1) }}" vars: qw1: "[?contains(generatedConfig, '{{ interface_name }}') == `true`].{TemplateName: templateName GeneratedConfig: generatedConfig}" -- name: show interface policy {{ interface_name }} +- name: worker show interface policy INTERFACE {{ interface_name }} debug: var: interface_config diff --git a/roles/ndfc_policy_vrf_rt_import/tasks/main.yml b/roles/ndfc_policy_vrf_rt_import/tasks/main.yml index b7fd20e..24f9b79 100644 --- a/roles/ndfc_policy_vrf_rt_import/tasks/main.yml +++ b/roles/ndfc_policy_vrf_rt_import/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_policy_vrf_rt_import/tasks/main.yml --- -- name: vrf route-target import/export +- name: main {{ state }} FABRIC {{ fabric_name }} DEVICE {{ device_name }} vrf route-target import/export include_tasks: worker.yml loop: "{{ r1 }}" vars: diff --git a/roles/ndfc_policy_vrf_rt_import/tasks/worker.yml b/roles/ndfc_policy_vrf_rt_import/tasks/worker.yml index 716d1c0..1fab920 100644 --- a/roles/ndfc_policy_vrf_rt_import/tasks/worker.yml +++ b/roles/ndfc_policy_vrf_rt_import/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_policy_vrf_rt_import/tasks/worker.yml -- name: "dcnm_policy {{ state }} {{ item.fabric }} {{ item.name }} {{ vrf_name }} importing {{ import_vrf_name }}.{{ import_vrf_asn }}:{{ import_vrf_index }}" +- name: worker {{ state }} {{ item.fabric }} {{ item.name }} {{ vrf_name }} importing {{ import_vrf_name }}.{{ import_vrf_asn }}:{{ import_vrf_index }} cisco.dcnm.dcnm_policy: state: "{{ state }}" deploy: true diff --git a/roles/ndfc_policy_vrf_rt_import_loop/tasks/main.yml b/roles/ndfc_policy_vrf_rt_import_loop/tasks/main.yml index a34e4ca..f6398b5 100644 --- a/roles/ndfc_policy_vrf_rt_import_loop/tasks/main.yml +++ b/roles/ndfc_policy_vrf_rt_import_loop/tasks/main.yml @@ -1,5 +1,5 @@ # ndfc_policy_vrf_rt_import_loop/tasks/main.yml --- -- name: vrf route-target import/export +- name: main {{ state }} VRF route-target import/export include_tasks: worker.yml loop: "{{ devices }}" diff --git a/roles/ndfc_policy_vrf_rt_import_loop/tasks/worker.yml b/roles/ndfc_policy_vrf_rt_import_loop/tasks/worker.yml index 93327fa..85e1336 100644 --- a/roles/ndfc_policy_vrf_rt_import_loop/tasks/worker.yml +++ b/roles/ndfc_policy_vrf_rt_import_loop/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_policy_vrf_rt_import_loop/tasks/policy_vrf_rt_import.yml -- name: "dcnm_policy {{ state }} {{ fabric_name }} {{ item }} {{ vrf_name }} importing {{ import_vrf_name }}.{{ import_vrf_asn }}:{{ import_vrf_index }}" +- name: worker {{ state }} FABRIC {{ fabric_name }} ITEM {{ item }} VRF_NAME {{ vrf_name }} import VRF.ASN:INDEX {{ import_vrf_name }}.{{ import_vrf_asn }}:{{ import_vrf_index }} cisco.dcnm.dcnm_policy: state: "{{ state }}" deploy: true diff --git a/roles/ndfc_vpc_create_rest/tasks/main.yml b/roles/ndfc_vpc_create_rest/tasks/main.yml index 0d9708d..a6c7755 100644 --- a/roles/ndfc_vpc_create_rest/tasks/main.yml +++ b/roles/ndfc_vpc_create_rest/tasks/main.yml @@ -7,7 +7,7 @@ # skip # set_fact for p1_serial, p1_vpc, p1_db_id -- name: "query {{ fabric_name }} {{ vpc_name }} vpc_peer_1 {{ ip }}" +- name: main query FABRIC {{ fabric_name }} VPC {{ vpc_name }} vpc_peer_1 {{ ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ fabric_name }}" state: query @@ -17,7 +17,7 @@ vars: q1: "[?fabric == '{{ fabric_name }}'] | [?vpc_name == '{{ vpc_name }}'].peer_1_ip | [0]" ip: "{{ vpc_peers | json_query(q1)}}" -- name: set_fact p1_serial, p1_vpc, p1_db_id +- name: main set_fact p1_serial, p1_vpc, p1_db_id set_fact: p1_serial: "{{ p1_result.response | json_query(q2) }}" p1_vpc: "{{ p1_result.response | json_query(q3) }}" @@ -27,7 +27,7 @@ q3: "[0].isVpcConfigured" q4: "[0].switchDbID" # set_fact for p2_serial, p2_vpc, p2_db_id -- name: "query {{ fabric_name }} {{ vpc_name }} vpc_peer_2" +- name: main query FABRIC {{ fabric_name }} VPC {{ vpc_name }} vpc_peer_2 cisco.dcnm.dcnm_inventory: fabric: "{{ fabric_name }}" state: query @@ -37,7 +37,7 @@ vars: q5: "[?fabric == '{{ fabric_name }}'] | [?vpc_name == '{{ vpc_name }}'].peer_2_ip | [0]" ip: "{{ vpc_peers | json_query(q5)}}" -- name: set_fact p2_serial, p2_vpc, p2_db_id +- name: main set_fact p2_serial, p2_vpc, p2_db_id set_fact: p2_serial: "{{ p2_result.response | json_query(q6) }}" p2_vpc: "{{ p2_result.response | json_query(q7) }}" @@ -48,7 +48,7 @@ q8: "[0].switchDbID" # Conditionally create vpc peering -- name: "Create VPC Peers {{ fabric_name }} {{ vpc_name }} {{ p1_vpc }}/{{ p2_vpc }} {{ p1_serial }}/{{ p2_serial }}" +- name: main REST create VPC Peers FABRIC {{ fabric_name }} VPC {{ vpc_name }} CONFIGURED {{ p1_vpc }}/{{ p2_vpc }} SERIAL {{ p1_serial }}/{{ p2_serial }}" cisco.dcnm.dcnm_rest: method: POST path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/vpcpair" diff --git a/roles/ndfc_vpc_delete_rest/tasks/main.yml b/roles/ndfc_vpc_delete_rest/tasks/main.yml index bce1011..66bd2ae 100644 --- a/roles/ndfc_vpc_delete_rest/tasks/main.yml +++ b/roles/ndfc_vpc_delete_rest/tasks/main.yml @@ -5,7 +5,7 @@ # and doesn't work. # Retrieve serial number and vpc config state for vpc_peer_1 -- name: "query vpc_peer_1 {{ fabric_name }} {{ vpc_name }}" +- name: main query vpc_peer_1 {{ fabric_name }} {{ vpc_name }} cisco.dcnm.dcnm_inventory: fabric: "{{ fabric_name }}" state: query @@ -15,7 +15,7 @@ vars: q1: "[?fabric == '{{ fabric_name }}'] | [?name == '{{ vpc_name }}'].peer_1_ip | [0]" ip: "{{ vpc_peers | json_query(q1)}}" -- name: set_fact vpc_peer_1 serial number +- name: main set_fact vpc_peer_1 serial number set_fact: p1_serial: "{{ p1_result.response | json_query(q2) }}" p1_vpc: "{{ p1_result.response | json_query(q3) }}" @@ -24,7 +24,7 @@ q3: "[0].isVpcConfigured" # Retrieve serial number and vpc config state for vpc_peer_2 -- name: "query vpc_peer_2 {{ fabric_name }} {{ vpc_name }}" +- name: main query vpc_peer_2 {{ fabric_name }} {{ vpc_name }} cisco.dcnm.dcnm_inventory: fabric: "{{ fabric_name }}" state: query @@ -34,10 +34,8 @@ vars: q4: "[?fabric == '{{ fabric_name }}'] | [?name == '{{ vpc_name }}'].peer_2_ip | [0]" ip: "{{ vpc_peers | json_query(q4)}}" -# - name: p2_result -# debug: -# var: p2_result -- name: set_fact vpc_peer_2 serial number + +- name: main set_fact vpc_peer_2 serial number set_fact: p2_serial: "{{ p2_result.response | json_query(q5) }}" p2_vpc: "{{ p2_result.response | json_query(q6) }}" @@ -45,12 +43,8 @@ q5: "[0].serialNumber" q6: "[0].isVpcConfigured" -# - name: check vars -# debug: -# msg: "{{ p1_vpc }}/{{ p2_vpc }} - {{ p1_serial }}/{{ p2_serial }}" - # Conditionally delete vpc peering -- name: "Delete VPC Peers {{ fabric_name }} {{ vpc_name }} {{ p1_vpc }}/{{ p2_vpc }} {{ p1_serial }}/{{ p2_serial }}" +- name: main REST DELETE VPC Peers {{ fabric_name }} {{ vpc_name }} {{ p1_vpc }}/{{ p2_vpc }} {{ p1_serial }}/{{ p2_serial }}" cisco.dcnm.dcnm_rest: method: DELETE path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/vpcpair" @@ -58,6 +52,4 @@ vars: vars_dict: serialNumber: "{{ p2_serial }}" - # peerTwoId: "{{ p2_serial }}" - # useVirtualPeerlink: "true" when: p1_serial != '' and p2_serial != '' and p1_vpc == True and p2_vpc == True diff --git a/roles/ndfc_vpc_interface_merged_all/tasks/main.yml b/roles/ndfc_vpc_interface_merged_all/tasks/main.yml index 448c599..b24b869 100644 --- a/roles/ndfc_vpc_interface_merged_all/tasks/main.yml +++ b/roles/ndfc_vpc_interface_merged_all/tasks/main.yml @@ -1,5 +1,5 @@ # ndfc_vpc_interface_merged_all/tasks/main.yml -- name: merge all vpc interfaces for a given vpc peer pair (vpc_name) +- name: main merged FABRIC {{ fabric_name }} VPC {{ vpc_name }} vpc_interface include_tasks: worker.yml loop: "{{ vpc_interfaces | json_query(q0) }}" vars: diff --git a/roles/ndfc_vpc_interface_merged_all/tasks/worker.yml b/roles/ndfc_vpc_interface_merged_all/tasks/worker.yml index b702e30..253d793 100644 --- a/roles/ndfc_vpc_interface_merged_all/tasks/worker.yml +++ b/roles/ndfc_vpc_interface_merged_all/tasks/worker.yml @@ -6,7 +6,7 @@ # skip # set_fact for p1_serial, p1_vpc, p1_db_id -- name: "query {{ item.fabric }} {{ item.vpc_name }} vpc_peer_1 {{ ip }}" +- name: worker query {{ item.fabric }} {{ item.vpc_name }} vpc_peer_1 {{ ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: query @@ -16,7 +16,7 @@ vars: q1: "[?fabric == '{{ item.fabric }}'] | [?vpc_name == '{{ item.vpc_name }}'].peer_1_ip | [0]" ip: "{{ vpc_peers | json_query(q1)}}" -- name: set_fact {{ item.fabric }} {{ item.vpc_name }} {{ item.vpc_port_id }} - p1_serial, p1_vpc, p1_db_id, p1_ip +- name: worker set_fact {{ item.fabric }} {{ item.vpc_name }} {{ item.vpc_port_id }} - p1_serial, p1_vpc, p1_db_id, p1_ip set_fact: p1_serial: "{{ p1_result.response | json_query(q2) }}" p1_vpc: "{{ p1_result.response | json_query(q3) }}" @@ -29,7 +29,7 @@ q5: "[0].ipAddress" # set_fact for p2_serial, p2_vpc, p2_db_id -- name: "query {{ item.fabric }} {{ item.vpc_name }} vpc_peer_2 {{ ip }}" +- name: worker query {{ item.fabric }} {{ item.vpc_name }} vpc_peer_2 {{ ip }} cisco.dcnm.dcnm_inventory: fabric: "{{ item.fabric }}" state: query @@ -39,10 +39,8 @@ vars: q6: "[?fabric == '{{ item.fabric }}'] | [?vpc_name == '{{ item.vpc_name }}'].peer_2_ip | [0]" ip: "{{ vpc_peers | json_query(q6)}}" -# - name: p2_result -# debug: -# var: p2_result -- name: set_fact {{ item.fabric }} {{ item.vpc_name }} {{ item.vpc_port_id }} - p2_serial, p2_vpc, p2_db_id, p2_ip + +- name: worker set_fact {{ item.fabric }} {{ item.vpc_name }} {{ item.vpc_port_id }} - p2_serial, p2_vpc, p2_db_id, p2_ip set_fact: p2_serial: "{{ p2_result.response | json_query(q7) }}" p2_vpc: "{{ p2_result.response | json_query(q8) }}" @@ -54,7 +52,7 @@ q9: "[0].switchDbID" q10: "[0].ipAddress" -- name: "merged {{ item.fabric }} {{ item.vpc_name }} {{ item.vpc_port_id }} {{ item.interface_mode }} {{ p1_ip }}/{{p2_ip}}" +- name: worker merged {{ item.fabric }} {{ item.vpc_name }} {{ item.vpc_port_id }} {{ item.interface_mode }} {{ p1_ip }}/{{p2_ip}} cisco.dcnm.dcnm_interface: fabric: "{{ item.fabric }}" state: merged diff --git a/roles/ndfc_vrf_all/tasks/main.yml b/roles/ndfc_vrf_all/tasks/main.yml index d7d01b6..5768a92 100644 --- a/roles/ndfc_vrf_all/tasks/main.yml +++ b/roles/ndfc_vrf_all/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_vrf/tasks/main.yml --- -- name: Update VRFs in fabric {{ fabric_name }} +- name: main {{ state }} FABRIC {{ fabric_name }} include_tasks: worker.yml loop: "{{ vrfs | json_query(query) }}" vars: diff --git a/roles/ndfc_vrf_all/tasks/worker.yml b/roles/ndfc_vrf_all/tasks/worker.yml index e59ecce..91be7df 100644 --- a/roles/ndfc_vrf_all/tasks/worker.yml +++ b/roles/ndfc_vrf_all/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_vrf/tasks/update_vrf.yml -- name: "{{ state }} FABRIC {{ item.fabric }} VRF {{ item.vrf_name }} VLAN {{ item.vlan_id }}" +- name: worker {{ state }} FABRIC {{ item.fabric }} VRF {{ item.vrf_name }} VLAN {{ item.vlan_id }} cisco.dcnm.dcnm_vrf: fabric: "{{ item.fabric }}" state: "{{ state }}" diff --git a/roles/ndfc_vrf_list_by_fabric_rest/tasks/main.yml b/roles/ndfc_vrf_list_by_fabric_rest/tasks/main.yml index 9a6a0b5..9172e54 100644 --- a/roles/ndfc_vrf_list_by_fabric_rest/tasks/main.yml +++ b/roles/ndfc_vrf_list_by_fabric_rest/tasks/main.yml @@ -3,7 +3,7 @@ # Return JSON object 'info' which will be a list of vrf dictionaries # if the GET request is successful, or an empty list if the GET request fails --- -- name: Retrieve list of VRFs in fabric {{ fabric_name }} +- name: main REST GET vrfs FABRIC {{ fabric_name }} cisco.dcnm.dcnm_rest: method: GET path: "/appcenter/cisco/ndfc/api/v1/lan-fabric/rest/top-down/fabrics/{{ fabric_name }}/vrfs" diff --git a/roles/ndfc_vrf_query/tasks/main.yml b/roles/ndfc_vrf_query/tasks/main.yml index 332def4..3afbfbb 100644 --- a/roles/ndfc_vrf_query/tasks/main.yml +++ b/roles/ndfc_vrf_query/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_vrf_replaced/tasks/main.yml --- -- name: query {{ fabric_name }} {{ vrf_name }} +- name: main query FABRIC {{ fabric_name }} VRF {{ vrf_name }} include_tasks: worker.yml loop: "{{ rm1 }}" vars: diff --git a/roles/ndfc_vrf_query/tasks/worker.yml b/roles/ndfc_vrf_query/tasks/worker.yml index 03373b9..e1d71cc 100644 --- a/roles/ndfc_vrf_query/tasks/worker.yml +++ b/roles/ndfc_vrf_query/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_vrf_query/tasks/worker.yml -- name: "query FABRIC {{ item.fabric }} VRF {{ item.vrf_name }}" +- name: worker query FABRIC {{ item.fabric }} VRF {{ item.vrf_name }} cisco.dcnm.dcnm_vrf: fabric: "{{ item.fabric }}" state: query diff --git a/roles/ndfc_vrf_replaced/tasks/main.yml b/roles/ndfc_vrf_replaced/tasks/main.yml index 24d7841..7c64fea 100644 --- a/roles/ndfc_vrf_replaced/tasks/main.yml +++ b/roles/ndfc_vrf_replaced/tasks/main.yml @@ -1,6 +1,6 @@ # ndfc_vrf_replaced/tasks/main.yml --- -- name: Update / Add VRFS +- name: main replaced FABRIC {{ fabric_name }} VRF {{ vrf_name }} include_tasks: worker.yml loop: "{{ r1 }}" vars: diff --git a/roles/ndfc_vrf_replaced/tasks/worker.yml b/roles/ndfc_vrf_replaced/tasks/worker.yml index 3f0d13e..8586b44 100644 --- a/roles/ndfc_vrf_replaced/tasks/worker.yml +++ b/roles/ndfc_vrf_replaced/tasks/worker.yml @@ -1,5 +1,5 @@ # ndfc_vrf_replaced/tasks/worker.yml -- name: "replaced FABRIC {{ item.fabric }} VRF {{ item.vrf_name }} VLAN {{ item.vlan_id }}" +- name: worker replaced FABRIC {{ item.fabric }} VRF {{ item.vrf_name }} VRF_ID {{ item.vrf_id }} VLAN {{ item.vlan_id }} cisco.dcnm.dcnm_vrf: fabric: "{{ item.fabric }}" state: replaced