-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modify appliance-multi-hosts to work on eco vsphere
- Loading branch information
1 parent
4e0b5fa
commit 9ed0ffa
Showing
3 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
tests/integration/targets/vmware_rest_appliance-multi-hosts/playbook.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,14 @@ | ||
- hosts: localhost | ||
gather_facts: no | ||
|
||
tasks: | ||
- name: Import eco-vcenter credentials | ||
ansible.builtin.include_vars: | ||
file: ../../integration_config.yml | ||
tags: eco-vcenter-ci | ||
|
||
- name: Import appliance multi-hosts role | ||
ansible.builtin.import_role: | ||
name: vmware_rest_appliance-multi-hosts | ||
tags: | ||
- eco-vcenter-ci |
65 changes: 65 additions & 0 deletions
65
tests/integration/targets/vmware_rest_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,65 @@ | ||
--- | ||
- name: Manage NTP Configuration on vCenter | ||
block: | ||
- name: Reset the NTP configuration | ||
vmware.vmware_rest.appliance_ntp: | ||
servers: | ||
- ca.pool.ntp.org | ||
delegate_to: localhost | ||
|
||
- name: Retrieve the initial NTP configuration | ||
vmware.vmware_rest.appliance_ntp_info: | ||
delegate_to: localhost | ||
|
||
- name: Set the NTP configuration to use google NTP servers | ||
vmware.vmware_rest.appliance_ntp: | ||
servers: | ||
- time.google.com | ||
delegate_to: localhost | ||
|
||
- name: Verify idempotency of NTP configuration | ||
vmware.vmware_rest.appliance_ntp: | ||
servers: | ||
- time.google.com | ||
delegate_to: localhost | ||
register: ntp_result | ||
|
||
- name: Debug idempotency result | ||
ansible.builtin.debug: | ||
var: ntp_result | ||
|
||
- name: Assert idempotency | ||
ansible.builtin.assert: | ||
that: | ||
- not (ntp_result.changed) | ||
|
||
- name: Retrieve the updated NTP configuration | ||
vmware.vmware_rest.appliance_ntp_info: | ||
delegate_to: localhost | ||
register: ntp_info | ||
|
||
- name: Debug updated NTP configuration | ||
ansible.builtin.debug: | ||
var: ntp_info | ||
|
||
- name: Assert the NTP configuration matches expected servers | ||
ansible.builtin.assert: | ||
that: | ||
- ntp_info.value == ["time.google.com"] | ||
|
||
- name: Test the NTP configuration connectivity | ||
vmware.vmware_rest.appliance_ntp: | ||
state: test | ||
servers: | ||
- time.google.com | ||
delegate_to: localhost | ||
register: ntp_test_result | ||
|
||
- name: Debug NTP test result | ||
ansible.builtin.debug: | ||
var: ntp_test_result | ||
|
||
- name: Ensure the NTP server is reachable | ||
ansible.builtin.assert: | ||
that: | ||
- ntp_test_result.value[0].status == "SERVER_REACHABLE" |
1 change: 1 addition & 0 deletions
1
tests/integration/targets/vmware_rest_appliance-multi-hosts/tasks/main.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 @@ | ||
- import_tasks: appliance_ntp.yml |