forked from ansible-collections/vmware.vmware_rest
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Test to validate we can run the same module in parallel. See: ansible-collections#364
- Loading branch information
Showing
7 changed files
with
101 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
network/vmware_rest | ||
zuul/vmware/vcenter_1esxi_with_nested | ||
disabled |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
vcenter1.test vcsa_host=vcenter1.test | ||
vcenter2.test vcsa_host=vcenter2.test | ||
vcenter3.test vcsa_host=vcenter3.test | ||
vcenter4.test vcsa_host=vcenter4.test | ||
vcenter5.test vcsa_host=vcenter5.test | ||
vcenter6.test vcsa_host=vcenter6.test | ||
vcenter7.test vcsa_host=vcenter7.test | ||
vcenter8.test vcsa_host=vcenter8.test | ||
vcenter9.test vcsa_host=vcenter9.test | ||
vcenter10.test vcsa_host=vcenter10.test | ||
vcenter11.test vcsa_host=vcenter11.test | ||
vcenter12.test vcsa_host=vcenter12.test | ||
vcenter13.test vcsa_host=vcenter13.test | ||
vcenter14.test vcsa_host=vcenter14.test | ||
vcenter15.test vcsa_host=vcenter15.test | ||
vcenter16.test vcsa_host=vcenter16.test | ||
vcenter17.test vcsa_host=vcenter17.test | ||
vcenter18.test vcsa_host=vcenter18.test | ||
vcenter19.test vcsa_host=vcenter19.test | ||
vcenter20.test vcsa_host=vcenter20.test |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
- hosts: all | ||
gather_facts: no | ||
collections: | ||
- vmware.vmware_rest | ||
tasks: | ||
- import_role: | ||
name: appliance-multi-hosts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/usr/bin/env bash | ||
source ../init.sh | ||
|
||
#export ANSIBLE_ROLES_PATH=.. | ||
#export VMWARE_HOST=localhost:8000/vcsa1 | ||
#export VMWARE_USER=root | ||
#export VMWARE_PASSWORD=password | ||
export VMWARE_VALIDATE_CERTS=no | ||
export VMWARE_REST_LOG_FILE=/tmp/toto.log | ||
|
||
exec ansible-playbook -i inventory playbook.yaml |
59 changes: 59 additions & 0 deletions
59
tests/integration/targets/appliance-multi-hosts/tasks/appliance_ntp.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
- name: _reset the NTP configuration | ||
vmware.vmware_rest.appliance_ntp: | ||
vcenter_hostname: "{{ vcsa_host }}" | ||
servers: | ||
- ca.pool.ntp.org | ||
delegate_to: localhost | ||
|
||
- name: Get the NTP configuration | ||
vmware.vmware_rest.appliance_ntp_info: | ||
vcenter_hostname: "{{ vcsa_host }}" | ||
delegate_to: localhost | ||
|
||
- name: Adjust the NTP configuration | ||
vmware.vmware_rest.appliance_ntp: | ||
vcenter_hostname: "{{ vcsa_host }}" | ||
servers: | ||
- time.google.com | ||
delegate_to: localhost | ||
|
||
- name: _Adjust the NTP configuration (again) | ||
vmware.vmware_rest.appliance_ntp: | ||
vcenter_hostname: "{{ vcsa_host }}" | ||
servers: | ||
- time.google.com | ||
delegate_to: localhost | ||
register: result | ||
|
||
- ansible.builtin.debug: var=result | ||
- name: Validate idempotency | ||
ansible.builtin.assert: | ||
that: | ||
- not (result.changed) | ||
|
||
- name: Get the NTP configuration | ||
vmware.vmware_rest.appliance_ntp_info: | ||
vcenter_hostname: "{{ vcsa_host }}" | ||
delegate_to: localhost | ||
register: result | ||
|
||
- ansible.builtin.debug: var=result | ||
- name: Assert the NTP configuration is right | ||
ansible.builtin.assert: | ||
that: | ||
- result.value == ["time.google.com"] | ||
|
||
- name: Test the NTP configuration | ||
vmware.vmware_rest.appliance_ntp: | ||
vcenter_hostname: "{{ vcsa_host }}" | ||
state: test | ||
servers: | ||
- time.google.com | ||
delegate_to: localhost | ||
register: result | ||
- ansible.builtin.debug: var=result | ||
|
||
- name: Ensure the result is successful | ||
ansible.builtin.assert: | ||
that: | ||
- result.value[0].status == "SERVER_REACHABLE" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- import_tasks: appliance_ntp.yaml |