From 67cc085a002899f3fe18dfe7dc11e556396f2640 Mon Sep 17 00:00:00 2001 From: anna-savina Date: Tue, 9 Jul 2024 09:20:09 +0300 Subject: [PATCH] added run_on_simulator var --- .../tasks/main.yml | 2 +- .../vmware_ops_cluster_settings_test/vars.yml | 2 ++ .../vars/main.yml | 2 ++ .../tasks/main.yml | 3 +-- .../vars/main.yml | 2 ++ .../vmware_ops_deploy_ovf_test/tasks/main.yml | 3 +-- .../vmware_ops_deploy_ovf_test/vars/main.yml | 1 + .../tasks/main.yml | 4 +-- .../vars.yml | 2 ++ .../vars/main.yml | 1 + .../tasks/main.yml | 3 +-- .../vars/main.yml | 2 ++ .../tasks/main.yml | 2 +- .../vmware_ops_manage_folder_test/vars.yml | 2 ++ .../vars/main.yml | 2 ++ .../tasks/main.yml | 4 +-- .../vars.yml | 2 ++ .../vars/main.yml | 2 ++ .../tasks/main.yml | 4 +-- .../vmware_ops_provision_vm_test/vars.yml | 3 +++ .../vars/main.yml | 2 ++ .../tasks/main.yml | 4 +-- .../vars.yml | 25 +++++++++++-------- .../vars/main.yml | 2 ++ .../tasks/main.yml | 4 +-- .../vars.yml | 2 ++ .../vars/main.yml | 1 + 27 files changed, 59 insertions(+), 29 deletions(-) diff --git a/tests/integration/targets/vmware_ops_cluster_settings_test/tasks/main.yml b/tests/integration/targets/vmware_ops_cluster_settings_test/tasks/main.yml index c70764df..c1a2a58f 100644 --- a/tests/integration/targets/vmware_ops_cluster_settings_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_cluster_settings_test/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Run cluster settings role on the vCenter Env - tags: eco-vcenter-ci + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: diff --git a/tests/integration/targets/vmware_ops_cluster_settings_test/vars.yml b/tests/integration/targets/vmware_ops_cluster_settings_test/vars.yml index 3be73328..c8b7c2f1 100644 --- a/tests/integration/targets/vmware_ops_cluster_settings_test/vars.yml +++ b/tests/integration/targets/vmware_ops_cluster_settings_test/vars.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: true + cluster_settings_hostname: "127.0.0.1" cluster_settings_username: "test" cluster_settings_password: "test" diff --git a/tests/integration/targets/vmware_ops_cluster_settings_test/vars/main.yml b/tests/integration/targets/vmware_ops_cluster_settings_test/vars/main.yml index 04af1cf9..b43d3bcf 100644 --- a/tests/integration/targets/vmware_ops_cluster_settings_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_cluster_settings_test/vars/main.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: false + cluster_settings_hostname: "{{ vcenter_hostname }}" cluster_settings_username: "{{ vcenter_username }}" cluster_settings_password: "{{ vcenter_password }}" diff --git a/tests/integration/targets/vmware_ops_content_library_test/tasks/main.yml b/tests/integration/targets/vmware_ops_content_library_test/tasks/main.yml index 78cf3fbd..952d3f8c 100644 --- a/tests/integration/targets/vmware_ops_content_library_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_content_library_test/tasks/main.yml @@ -1,7 +1,6 @@ --- - name: Test - tags: - - eco-vcenter-ci + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: diff --git a/tests/integration/targets/vmware_ops_content_library_test/vars/main.yml b/tests/integration/targets/vmware_ops_content_library_test/vars/main.yml index e68d998f..8a39b9dd 100644 --- a/tests/integration/targets/vmware_ops_content_library_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_content_library_test/vars/main.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: false + content_library_hostname: "{{ vcenter_hostname }}" content_library_username: "{{ vcenter_username }}" content_library_password: "{{ vcenter_password }}" diff --git a/tests/integration/targets/vmware_ops_deploy_ovf_test/tasks/main.yml b/tests/integration/targets/vmware_ops_deploy_ovf_test/tasks/main.yml index 35b31884..bd4ff13d 100644 --- a/tests/integration/targets/vmware_ops_deploy_ovf_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_deploy_ovf_test/tasks/main.yml @@ -1,7 +1,6 @@ --- - name: Setup - tags: - - eco-vcenter-ci + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: diff --git a/tests/integration/targets/vmware_ops_deploy_ovf_test/vars/main.yml b/tests/integration/targets/vmware_ops_deploy_ovf_test/vars/main.yml index 0fba6050..e062f406 100644 --- a/tests/integration/targets/vmware_ops_deploy_ovf_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_deploy_ovf_test/vars/main.yml @@ -1,4 +1,5 @@ --- +run_on_simulator: false vmware_deploy_ovf_test_export_dir: /tmp deploy_ovf_hostname: "{{ vcenter_hostname }}" diff --git a/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/tasks/main.yml b/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/tasks/main.yml index 28ddc6c2..3e6053f9 100644 --- a/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Test esxi maintenance on simulator - tags: integration-ci + when: run_on_simulator block: - name: Enable Maintenance Mode ansible.builtin.include_role: @@ -15,7 +15,7 @@ esxi_maintenance_mode_enable: False - name: Test esxi maintenance mode on vcenter env - tags: eco-vcenter-ci + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: diff --git a/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars.yml b/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars.yml index 4d5b1583..63521163 100644 --- a/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars.yml +++ b/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: true + esxi_maintenance_mode_hostname: "127.0.0.1" esxi_maintenance_mode_username: "test" esxi_maintenance_mode_password: "test" diff --git a/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars/main.yml b/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars/main.yml index 151ceea6..074ae4d4 100644 --- a/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_esxi_maintenance_mode_test/vars/main.yml @@ -1,5 +1,6 @@ --- # General vars +run_on_simulator: false resource_prefix: host-maintenance resource_pool_name: "{{ resource_prefix }}-pool" diff --git a/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/tasks/main.yml b/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/tasks/main.yml index 9d861750..09fadf3a 100644 --- a/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/tasks/main.yml @@ -1,7 +1,6 @@ --- - name: Test - tags: - - eco-vcenter-ci + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: diff --git a/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/vars/main.yml b/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/vars/main.yml index c727d7ff..9ebd98e3 100644 --- a/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_export_vm_as_ovf_test/vars/main.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: false + export_vm_as_ovf_hostname: "{{ vcenter_hostname }}" export_vm_as_ovf_username: "{{ vcenter_username }}" export_vm_as_ovf_password: "{{ vcenter_password }}" diff --git a/tests/integration/targets/vmware_ops_manage_folder_test/tasks/main.yml b/tests/integration/targets/vmware_ops_manage_folder_test/tasks/main.yml index 5751cd74..8c6cee49 100644 --- a/tests/integration/targets/vmware_ops_manage_folder_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_manage_folder_test/tasks/main.yml @@ -2,7 +2,7 @@ - name: Import common vars for tests on vCenter Environment ansible.builtin.include_vars: file: ../group_vars.yml - tags: eco-vcenter-ci + when: not run_on_simulator - name: Create Folder Tree loop: "{{ folder_types }}" diff --git a/tests/integration/targets/vmware_ops_manage_folder_test/vars.yml b/tests/integration/targets/vmware_ops_manage_folder_test/vars.yml index 36d4edf6..56c75219 100644 --- a/tests/integration/targets/vmware_ops_manage_folder_test/vars.yml +++ b/tests/integration/targets/vmware_ops_manage_folder_test/vars.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: true + manage_folder_hostname: "127.0.0.1" manage_folder_username: "test" manage_folder_password: "test" diff --git a/tests/integration/targets/vmware_ops_manage_folder_test/vars/main.yml b/tests/integration/targets/vmware_ops_manage_folder_test/vars/main.yml index 786949e7..af639c42 100644 --- a/tests/integration/targets/vmware_ops_manage_folder_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_manage_folder_test/vars/main.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: false + manage_folder_hostname: "{{ vcenter_hostname }}" manage_folder_username: "{{ vcenter_username }}" manage_folder_password: "{{ vcenter_password }}" diff --git a/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/tasks/main.yml b/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/tasks/main.yml index 46fdb6a7..e5113a48 100644 --- a/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/tasks/main.yml @@ -1,11 +1,11 @@ --- - name: Test Virtual Esxi Provisioning on Simulator - tags: integration-ci + when: run_on_simulator ansible.builtin.include_role: name: cloud.vmware_ops.provision_virtual_esxi - name: Test Virtual Esxi Provisioning on vCenter Env - tags: eco-vcenter-ci + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: diff --git a/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars.yml b/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars.yml index 7b271f62..09aff66c 100644 --- a/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars.yml +++ b/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: true + provision_virtual_esxi_hostname: "127.0.0.1" provision_virtual_esxi_username: "test" provision_virtual_esxi_password: "test" diff --git a/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars/main.yml b/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars/main.yml index 54bfee41..f5da6f8c 100644 --- a/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_provision_virtual_esxi_test/vars/main.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: false + provision_virtual_esxi_hostname: "{{ vcenter_hostname }}" provision_virtual_esxi_username: "{{ vcenter_username }}" provision_virtual_esxi_password: "{{ vcenter_password }}" diff --git a/tests/integration/targets/vmware_ops_provision_vm_test/tasks/main.yml b/tests/integration/targets/vmware_ops_provision_vm_test/tasks/main.yml index 09514c09..a2572912 100644 --- a/tests/integration/targets/vmware_ops_provision_vm_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_provision_vm_test/tasks/main.yml @@ -2,9 +2,10 @@ - name: Provision VM for simulator ansible.builtin.import_role: name: cloud.vmware_ops.provision_vm - tags: integration-ci + when: run_on_simulator - name: Perform VM Lifecycle Operations in vCenter Environment + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: @@ -48,4 +49,3 @@ switch: "{{ vswitch_name }}" portgroup: "{{ portgroup_name }}" state: absent - tags: eco-vcenter-ci diff --git a/tests/integration/targets/vmware_ops_provision_vm_test/vars.yml b/tests/integration/targets/vmware_ops_provision_vm_test/vars.yml index afda0716..8915584b 100644 --- a/tests/integration/targets/vmware_ops_provision_vm_test/vars.yml +++ b/tests/integration/targets/vmware_ops_provision_vm_test/vars.yml @@ -1,3 +1,6 @@ +--- +run_on_simulator: true + provision_vm_hostname: "127.0.0.1" provision_vm_username: "test" provision_vm_password: "test" diff --git a/tests/integration/targets/vmware_ops_provision_vm_test/vars/main.yml b/tests/integration/targets/vmware_ops_provision_vm_test/vars/main.yml index e24a060b..db9e20f4 100644 --- a/tests/integration/targets/vmware_ops_provision_vm_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_provision_vm_test/vars/main.yml @@ -1,4 +1,6 @@ # vars.yaml +run_on_simulator: false + provision_vm_hostname: "{{ vcenter_hostname }}" provision_vm_username: "{{ vcenter_username }}" provision_vm_password: "{{ vcenter_password }}" diff --git a/tests/integration/targets/vmware_ops_snapshot_management_test/tasks/main.yml b/tests/integration/targets/vmware_ops_snapshot_management_test/tasks/main.yml index 61997877..81060667 100644 --- a/tests/integration/targets/vmware_ops_snapshot_management_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_snapshot_management_test/tasks/main.yml @@ -4,9 +4,10 @@ ignore_errors: true ansible.builtin.import_role: name: cloud.vmware_ops.snapshot_management - tags: integration-ci + when: run_on_simulator - name: Test VM snapshot management role in vCenter Environment + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: @@ -49,4 +50,3 @@ vars: provision_vm_state: absent provision_vm_force: true - tags: eco-vcenter-ci \ No newline at end of file diff --git a/tests/integration/targets/vmware_ops_snapshot_management_test/vars.yml b/tests/integration/targets/vmware_ops_snapshot_management_test/vars.yml index 5ac8c739..332907b7 100644 --- a/tests/integration/targets/vmware_ops_snapshot_management_test/vars.yml +++ b/tests/integration/targets/vmware_ops_snapshot_management_test/vars.yml @@ -1,11 +1,14 @@ - snapshot_management_hostname: "127.0.0.1" - snapshot_management_username: "test" - snapshot_management_password: "test" - snapshot_management_validate_certs: false - snapshot_management_folder: "/DC0/vm" - snapshot_management_datacenter: "DC0" - snapshot_management_vm_name: "DC0_H0_VM0" - snapshot_management_port: "8989" - snapshot_management_state: present - snapshot_management_snapshot_name: "snap1" - snapshot_management_snapshot_description: "snap1_description" \ No newline at end of file +--- +run_on_simulator: true + +snapshot_management_hostname: "127.0.0.1" +snapshot_management_username: "test" +snapshot_management_password: "test" +snapshot_management_validate_certs: false +snapshot_management_folder: "/DC0/vm" +snapshot_management_datacenter: "DC0" +snapshot_management_vm_name: "DC0_H0_VM0" +snapshot_management_port: "8989" +snapshot_management_state: present +snapshot_management_snapshot_name: "snap1" +snapshot_management_snapshot_description: "snap1_description" \ No newline at end of file diff --git a/tests/integration/targets/vmware_ops_snapshot_management_test/vars/main.yml b/tests/integration/targets/vmware_ops_snapshot_management_test/vars/main.yml index 87b4a7c0..8352b965 100644 --- a/tests/integration/targets/vmware_ops_snapshot_management_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_snapshot_management_test/vars/main.yml @@ -1,4 +1,6 @@ # vars.yaml +run_on_simulator: false + snapshot_management_hostname: "{{ vcenter_hostname }}" snapshot_management_username: "{{ vcenter_username }}" snapshot_management_password: "{{ vcenter_password }}" diff --git a/tests/integration/targets/vmware_ops_vcenter_host_connection_test/tasks/main.yml b/tests/integration/targets/vmware_ops_vcenter_host_connection_test/tasks/main.yml index f152e122..c490a515 100644 --- a/tests/integration/targets/vmware_ops_vcenter_host_connection_test/tasks/main.yml +++ b/tests/integration/targets/vmware_ops_vcenter_host_connection_test/tasks/main.yml @@ -1,6 +1,6 @@ --- - name: Test vCenter host connection role on vCenter env - tags: eco-vcenter-ci + when: not run_on_simulator block: - name: Import common vars ansible.builtin.include_vars: @@ -89,7 +89,7 @@ required_state: absent - name: Test vCenter host connection role on simulator - tags: integration-ci + when: run_on_simulator block: - name: Add ESXI Host to vCenter Cluster ansible.builtin.import_role: diff --git a/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars.yml b/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars.yml index 20c4996a..90c33d4c 100644 --- a/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars.yml +++ b/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars.yml @@ -1,4 +1,6 @@ --- +run_on_simulator: true + vcenter_host_connection_hostname: "127.0.0.1" vcenter_host_connection_username: "test" vcenter_host_connection_password: "test" diff --git a/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars/main.yml b/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars/main.yml index 57b36b42..e436b6b3 100644 --- a/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars/main.yml +++ b/tests/integration/targets/vmware_ops_vcenter_host_connection_test/vars/main.yml @@ -1,5 +1,6 @@ --- # General +run_on_simulator: false resource_pool_name: "host-connection-test-pool" # Vars for cloud.vmware_ops.provision_virtual_esxi role