From fe5cfa9921e14118e3c8ae04fb0756371414ade0 Mon Sep 17 00:00:00 2001 From: anna-savina Date: Tue, 2 Jul 2024 10:47:37 +0300 Subject: [PATCH] added group_vars.yml --- tests/integration/targets/group_vars.yml | 6 ++++++ .../targets/vmware_appliance_info/defaults/main.yml | 1 - .../targets/vmware_appliance_info/tasks/main.yml | 5 +++++ .../targets/vmware_content_template/defaults/main.yml | 7 +++---- .../targets/vmware_content_template/tasks/main.yml | 5 +++++ .../targets/vmware_guest_info/defaults/main.yml | 1 - tests/integration/targets/vmware_guest_info/tasks/main.yml | 5 +++++ .../targets/vmware_license_info/defaults/main.yml | 2 +- .../integration/targets/vmware_license_info/tasks/main.yml | 5 +++++ .../defaults/main.yml | 7 +++---- .../vmware_vm_list_group_by_clusters_info/tasks/main.yml | 5 +++++ 11 files changed, 38 insertions(+), 11 deletions(-) create mode 100644 tests/integration/targets/group_vars.yml diff --git a/tests/integration/targets/group_vars.yml b/tests/integration/targets/group_vars.yml new file mode 100644 index 00000000..c28f1899 --- /dev/null +++ b/tests/integration/targets/group_vars.yml @@ -0,0 +1,6 @@ +--- +# vcenter specific vars +# please edit according to your vcenter configs +vcenter_cluster_name: "Eco-Cluster" +vcenter_datacenter: "Eco-Datacenter" +vcenter_port: 443 diff --git a/tests/integration/targets/vmware_appliance_info/defaults/main.yml b/tests/integration/targets/vmware_appliance_info/defaults/main.yml index 360d48df..9287df4b 100644 --- a/tests/integration/targets/vmware_appliance_info/defaults/main.yml +++ b/tests/integration/targets/vmware_appliance_info/defaults/main.yml @@ -1,2 +1 @@ -vcenter_port: 443 appliance_hostname: "{{ vcenter_hostname }}" \ No newline at end of file diff --git a/tests/integration/targets/vmware_appliance_info/tasks/main.yml b/tests/integration/targets/vmware_appliance_info/tasks/main.yml index 06aab05c..63bbae1f 100644 --- a/tests/integration/targets/vmware_appliance_info/tasks/main.yml +++ b/tests/integration/targets/vmware_appliance_info/tasks/main.yml @@ -1,4 +1,9 @@ --- +- name: Import common vars + ansible.builtin.include_vars: + file: ../group_vars.yml + when: not run_on_simulator + - name: Gather appliance info vmware.vmware.appliance_info: validate_certs: false diff --git a/tests/integration/targets/vmware_content_template/defaults/main.yml b/tests/integration/targets/vmware_content_template/defaults/main.yml index a8a5713e..2d877471 100644 --- a/tests/integration/targets/vmware_content_template/defaults/main.yml +++ b/tests/integration/targets/vmware_content_template/defaults/main.yml @@ -1,10 +1,9 @@ -vcenter_port: 443 run_on_simulator: false vm: "{{ tiny_prefix }}-vm" -vm_cluster: "Eco-Cluster" -vm_datacenter: "Eco-Datacenter" -vm_folder: "/Eco-Datacenter/vm/e2e-qe" +vm_cluster: "{{ vcenter_cluster_name }}" +vm_datacenter: "{{ vcenter_datacenter }}" +vm_folder: "/{{ vcenter_datacenter }}/vm/e2e-qe" vm_guest_id: "rhel8_64Guest" vm_disk: - size_gb: 10 diff --git a/tests/integration/targets/vmware_content_template/tasks/main.yml b/tests/integration/targets/vmware_content_template/tasks/main.yml index 43f976db..e519ff0e 100644 --- a/tests/integration/targets/vmware_content_template/tasks/main.yml +++ b/tests/integration/targets/vmware_content_template/tasks/main.yml @@ -1,5 +1,10 @@ --- - block: + - name: Import common vars + ansible.builtin.include_vars: + file: ../group_vars.yml + when: not run_on_simulator + - name: "Test setup: Create VM guest {{ vm }}" community.vmware.vmware_guest: validate_certs: false diff --git a/tests/integration/targets/vmware_guest_info/defaults/main.yml b/tests/integration/targets/vmware_guest_info/defaults/main.yml index eeb7fc62..9553fc45 100644 --- a/tests/integration/targets/vmware_guest_info/defaults/main.yml +++ b/tests/integration/targets/vmware_guest_info/defaults/main.yml @@ -1,4 +1,3 @@ -vcenter_port: 443 run_on_simulator: false guests_length: 1 diff --git a/tests/integration/targets/vmware_guest_info/tasks/main.yml b/tests/integration/targets/vmware_guest_info/tasks/main.yml index 3801dfe1..5fc79f7b 100644 --- a/tests/integration/targets/vmware_guest_info/tasks/main.yml +++ b/tests/integration/targets/vmware_guest_info/tasks/main.yml @@ -1,6 +1,11 @@ --- # note: this test will fail due to the below known bug: # https://issues.redhat.com/browse/ACA-1650 +- name: Import common vars + ansible.builtin.include_vars: + file: ../group_vars.yml + when: not run_on_simulator + - name: Gather guest info vmware.vmware.guest_info: validate_certs: false diff --git a/tests/integration/targets/vmware_license_info/defaults/main.yml b/tests/integration/targets/vmware_license_info/defaults/main.yml index 79fa7f58..8293465a 100644 --- a/tests/integration/targets/vmware_license_info/defaults/main.yml +++ b/tests/integration/targets/vmware_license_info/defaults/main.yml @@ -1,2 +1,2 @@ -vcenter_port: 443 +run_on_simulator: false licenses_length: 5 diff --git a/tests/integration/targets/vmware_license_info/tasks/main.yml b/tests/integration/targets/vmware_license_info/tasks/main.yml index 9356e178..155e4a29 100644 --- a/tests/integration/targets/vmware_license_info/tasks/main.yml +++ b/tests/integration/targets/vmware_license_info/tasks/main.yml @@ -1,4 +1,9 @@ --- +- name: Import common vars + ansible.builtin.include_vars: + file: ../group_vars.yml + when: not run_on_simulator + - name: Gather license info vmware.vmware.license_info: validate_certs: false diff --git a/tests/integration/targets/vmware_vm_list_group_by_clusters_info/defaults/main.yml b/tests/integration/targets/vmware_vm_list_group_by_clusters_info/defaults/main.yml index d5e74a2b..728f7d9f 100644 --- a/tests/integration/targets/vmware_vm_list_group_by_clusters_info/defaults/main.yml +++ b/tests/integration/targets/vmware_vm_list_group_by_clusters_info/defaults/main.yml @@ -1,12 +1,11 @@ -vcenter_port: 443 run_on_simulator: false test_folder: "{{ tiny_prefix }}-folder" vm_name: "{{ tiny_prefix }}-vm" -vm_cluster: "Eco-Cluster" -vm_datacenter: "Eco-Datacenter" -vm_folder: "/Eco-Datacenter/vm/{{ test_folder }}" +vm_cluster: "{{ vcenter_cluster_name }}" +vm_datacenter: "{{ vcenter_datacenter }}" +vm_folder: "/{{ vcenter_datacenter }}/vm/{{ test_folder }}" vm_guest_id: "rhel8_64Guest" vm_disk: - size_gb: 10 diff --git a/tests/integration/targets/vmware_vm_list_group_by_clusters_info/tasks/main.yml b/tests/integration/targets/vmware_vm_list_group_by_clusters_info/tasks/main.yml index 0b5eda2f..3dad72b9 100644 --- a/tests/integration/targets/vmware_vm_list_group_by_clusters_info/tasks/main.yml +++ b/tests/integration/targets/vmware_vm_list_group_by_clusters_info/tasks/main.yml @@ -1,5 +1,10 @@ --- - block: + - name: Import common vars + ansible.builtin.include_vars: + file: ../group_vars.yml + when: not run_on_simulator + - name: "Test setup: Create VM folder {{ test_folder }}" community.vmware.vcenter_folder: validate_certs: false