From 28ff3e9535a75c291f70e422a77972bccce6ddcd Mon Sep 17 00:00:00 2001 From: George Ghawali Date: Wed, 11 Dec 2024 08:17:18 +0200 Subject: [PATCH 1/2] enable logs in loops --- .../tasks/all_operations.yml | 1 - .../ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml | 2 -- .../ntnx_recovery_points_v2/tasks/recovery_points.yml | 3 --- .../tasks/application_rules_and_info_tests.yml | 10 ---------- .../tasks/isolation_rules_tests.yml | 4 ---- .../ntnx_storage_containers_v2/tasks/all_operation.yml | 1 - .../targets/ntnx_users_v2/tasks/users_operations.yml | 2 -- .../ntnx_vms_disks_v2/tasks/disks_operations.yml | 5 ----- .../ntnx_vms_v2/tasks/create_delete_info_vm.yml | 1 - .../nutanix_subnets_v2/tasks/subnet_operations.yml | 2 -- 10 files changed, 31 deletions(-) diff --git a/tests/integration/targets/ntnx_authorization_policies_v2/tasks/all_operations.yml b/tests/integration/targets/ntnx_authorization_policies_v2/tasks/all_operations.yml index 107a89b4..5d20044c 100644 --- a/tests/integration/targets/ntnx_authorization_policies_v2/tasks/all_operations.yml +++ b/tests/integration/targets/ntnx_authorization_policies_v2/tasks/all_operations.yml @@ -483,7 +483,6 @@ success_msg: Delete created auth policies passed loop: "{{ result.results }}" when: todelete | length > 0 and result | length > 0 - no_log: true - name: Reset todelete ansible.builtin.set_fact: diff --git a/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml b/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml index f1fda2b1..823ba4ee 100644 --- a/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml +++ b/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml @@ -265,7 +265,6 @@ register: results ignore_errors: true changed_when: results.rc != 0 - no_log: true # verify that all nodes are unconfigured by checking the return code and stderr in all of them - name: Assert that all cluster nodes are unconfigured @@ -297,7 +296,6 @@ fail_msg: "Discover unconfigured nodes failed" success_msg: "Discover unconfigured nodes passed" loop: "{{ results.results }}" - no_log: true - name: Run cluster create prechecks ntnx_clusters_v2: diff --git a/tests/integration/targets/ntnx_recovery_points_v2/tasks/recovery_points.yml b/tests/integration/targets/ntnx_recovery_points_v2/tasks/recovery_points.yml index f214bfb3..3adc4aa4 100644 --- a/tests/integration/targets/ntnx_recovery_points_v2/tasks/recovery_points.yml +++ b/tests/integration/targets/ntnx_recovery_points_v2/tasks/recovery_points.yml @@ -1025,7 +1025,6 @@ loop: "{{ result.results }}" loop_control: index_var: recovery_point_index - no_log: true ######################################################################################################## @@ -1052,7 +1051,6 @@ loop: "{{ result.results }}" loop_control: index_var: vgs_index - no_log: true ######################################################################################################## @@ -1079,7 +1077,6 @@ loop: "{{ result.results }}" loop_control: index_var: vms_index - no_log: true - name: Reset to delete lists ansible.builtin.set_fact: diff --git a/tests/integration/targets/ntnx_security_rules_v2/tasks/application_rules_and_info_tests.yml b/tests/integration/targets/ntnx_security_rules_v2/tasks/application_rules_and_info_tests.yml index b81e9611..708ee33a 100644 --- a/tests/integration/targets/ntnx_security_rules_v2/tasks/application_rules_and_info_tests.yml +++ b/tests/integration/targets/ntnx_security_rules_v2/tasks/application_rules_and_info_tests.yml @@ -56,7 +56,6 @@ fail_msg: Failed to create category success_msg: Successfully created category loop: "{{ results.results }}" - no_log: true - name: Set categories to be used in security rules ansible.builtin.set_fact: @@ -234,7 +233,6 @@ with_items: "{{ result.response.rules }}" loop_control: index_var: item_index - no_log: true - name: Find index of 'inbound2' ansible.builtin.set_fact: @@ -243,7 +241,6 @@ with_items: "{{ result.response.rules }}" loop_control: index_var: item_index - no_log: true - name: Find index of 'outbound1' ansible.builtin.set_fact: @@ -252,7 +249,6 @@ with_items: "{{ result.response.rules }}" loop_control: index_var: item_index - no_log: true - name: Verify creation status ansible.builtin.assert: @@ -339,7 +335,6 @@ ansible.builtin.set_fact: rule_map: "{{ rule_map | default({}) | combine({item.description: item}) }}" loop: "{{ result.response.rules }}" - no_log: true - name: Verify creation status ansible.builtin.assert: @@ -468,7 +463,6 @@ ansible.builtin.set_fact: rule_map: "{{ rule_map | default({}) | combine({item.description: item}) }}" loop: "{{ result.response.rules }}" - no_log: true - name: Verify creation status ansible.builtin.assert: @@ -770,7 +764,6 @@ ansible.builtin.set_fact: rule_map: "{{ rule_map | default({}) | combine({item.description: item}) }}" loop: "{{ result.response.rules }}" - no_log: true - name: Verify updated policy status ansible.builtin.assert: @@ -983,7 +976,6 @@ ansible.builtin.set_fact: rule_map: "{{ rule_map | default({}) | combine({item.description: item}) }}" loop: "{{ result.response.rules }}" - no_log: true - name: Verify update status ansible.builtin.assert: @@ -1160,7 +1152,6 @@ "{{ category4 }}", "{{ category5 }}", ] - no_log: true - name: Verify deletion status ansible.builtin.assert: @@ -1170,4 +1161,3 @@ fail_msg: Failed to delete category success_msg: Successfully deleted category loop: "{{ result.results }}" - no_log: true diff --git a/tests/integration/targets/ntnx_security_rules_v2/tasks/isolation_rules_tests.yml b/tests/integration/targets/ntnx_security_rules_v2/tasks/isolation_rules_tests.yml index cb5b1eb7..481ade23 100644 --- a/tests/integration/targets/ntnx_security_rules_v2/tasks/isolation_rules_tests.yml +++ b/tests/integration/targets/ntnx_security_rules_v2/tasks/isolation_rules_tests.yml @@ -24,7 +24,6 @@ description: ansible test register: results loop: [0, 1, 2, 3] - no_log: true - name: Verify category creation status ansible.builtin.assert: @@ -35,7 +34,6 @@ fail_msg: Failed to create category success_msg: Successfully created category loop: "{{ results.results }}" - no_log: true - name: Set categories to be used in security rules ansible.builtin.set_fact: @@ -233,7 +231,6 @@ register: result loop: ["{{ category1 }}", "{{ category2 }}", "{{ category3 }}", "{{ category4 }}"] - no_log: true - name: Verify deletion status ansible.builtin.assert: @@ -243,4 +240,3 @@ fail_msg: Failed to delete category success_msg: Successfully deleted category loop: "{{ result.results }}" - no_log: true diff --git a/tests/integration/targets/ntnx_storage_containers_v2/tasks/all_operation.yml b/tests/integration/targets/ntnx_storage_containers_v2/tasks/all_operation.yml index c550cab2..737322c6 100644 --- a/tests/integration/targets/ntnx_storage_containers_v2/tasks/all_operation.yml +++ b/tests/integration/targets/ntnx_storage_containers_v2/tasks/all_operation.yml @@ -392,7 +392,6 @@ loop: "{{ result.results }}" loop_control: index_var: storage_containers_index - no_log: true - name: Reset to delete list ansible.builtin.set_fact: diff --git a/tests/integration/targets/ntnx_users_v2/tasks/users_operations.yml b/tests/integration/targets/ntnx_users_v2/tasks/users_operations.yml index ec0f76df..bf88f29e 100644 --- a/tests/integration/targets/ntnx_users_v2/tasks/users_operations.yml +++ b/tests/integration/targets/ntnx_users_v2/tasks/users_operations.yml @@ -612,7 +612,6 @@ loop: "{{ todelete }}" register: result ignore_errors: true - no_log: true - name: Delete created users status ansible.builtin.assert: @@ -625,7 +624,6 @@ success_msg: Delete created users passed loop: "{{ result.results }}" when: todelete | length > 0 and result | length > 0 - no_log: true - name: Reset todelete list ansible.builtin.set_fact: diff --git a/tests/integration/targets/ntnx_vms_disks_v2/tasks/disks_operations.yml b/tests/integration/targets/ntnx_vms_disks_v2/tasks/disks_operations.yml index 1f480c92..532b0981 100644 --- a/tests/integration/targets/ntnx_vms_disks_v2/tasks/disks_operations.yml +++ b/tests/integration/targets/ntnx_vms_disks_v2/tasks/disks_operations.yml @@ -632,7 +632,6 @@ fail_msg: "List all disks from VM failed" success_msg: "List all disks from VM passed" loop: "{{ result.response }}" - no_log: true ################################################################################# @@ -654,7 +653,6 @@ fail_msg: "List all disks from VM with limit 1 failed" success_msg: "List all disks from VM with limit 1 passed" loop: "{{ result.response }}" - no_log: true ################################################################################# @@ -676,7 +674,6 @@ fail_msg: "List all disks from VM with limit 2 failed" success_msg: "List all disks from VM with limit 2 passed" loop: "{{ result.response }}" - no_log: true ################################################################################# @@ -688,7 +685,6 @@ register: result ignore_errors: true loop: "{{ todelete }}" - no_log: true - name: Deletion Status ansible.builtin.assert: @@ -702,7 +698,6 @@ fail_msg: "Unable to delete disks from VM " success_msg: "Disks from VM are deleted successfully " loop: "{{ result.results }}" - no_log: true ################################################################################ diff --git a/tests/integration/targets/ntnx_vms_v2/tasks/create_delete_info_vm.yml b/tests/integration/targets/ntnx_vms_v2/tasks/create_delete_info_vm.yml index eef09036..a8bd5851 100644 --- a/tests/integration/targets/ntnx_vms_v2/tasks/create_delete_info_vm.yml +++ b/tests/integration/targets/ntnx_vms_v2/tasks/create_delete_info_vm.yml @@ -590,7 +590,6 @@ loop: "{{ result.results }}" loop_control: index_var: vms_index - no_log: true - name: Reset to delete list ansible.builtin.set_fact: diff --git a/tests/integration/targets/nutanix_subnets_v2/tasks/subnet_operations.yml b/tests/integration/targets/nutanix_subnets_v2/tasks/subnet_operations.yml index 8c47b3d4..c9f27f8c 100644 --- a/tests/integration/targets/nutanix_subnets_v2/tasks/subnet_operations.yml +++ b/tests/integration/targets/nutanix_subnets_v2/tasks/subnet_operations.yml @@ -371,7 +371,6 @@ fail_msg: "Unable to delete Subnet " success_msg: "Subnet is deleted successfully " loop: "{{ result.results }}" - no_log: true - name: Reset todelete list ansible.builtin.set_fact: @@ -923,7 +922,6 @@ fail_msg: "Unable to delete Subnet " success_msg: "Subnet is deleted successfully " loop: "{{ result.results }}" - no_log: true - name: Reset todelete list ansible.builtin.set_fact: From 729ec6b75380272327f3dcd3243a78adf01aa030 Mon Sep 17 00:00:00 2001 From: George Ghawali Date: Wed, 11 Dec 2024 08:42:01 +0200 Subject: [PATCH 2/2] resolving comments --- .../targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml b/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml index 823ba4ee..f1fda2b1 100644 --- a/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml +++ b/tests/integration/targets/ntnx_clusters_nodes_v2/tasks/add_remove_nodes.yml @@ -265,6 +265,7 @@ register: results ignore_errors: true changed_when: results.rc != 0 + no_log: true # verify that all nodes are unconfigured by checking the return code and stderr in all of them - name: Assert that all cluster nodes are unconfigured @@ -296,6 +297,7 @@ fail_msg: "Discover unconfigured nodes failed" success_msg: "Discover unconfigured nodes passed" loop: "{{ results.results }}" + no_log: true - name: Run cluster create prechecks ntnx_clusters_v2: