Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update cluster_info refs from community to vmware #114

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions changelogs/fragments/113-update-cluster-info-refs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
minor_changes:
- info - updated role to use vmware.vmware version of module instead of community and vmware_rest versions
80 changes: 54 additions & 26 deletions roles/info/tasks/cluster_info.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,58 @@
- name: Get clusters
vmware.vmware_rest.vcenter_cluster_info:
vcenter_hostname: "{{ info_hostport }}"
vcenter_username: "{{ info_username }}"
vcenter_password: "{{ info_password }}"
vcenter_validate_certs: "{{ info_validate_certs | default(omit) }}"
register: __clusters
tags:
- cluster
---
- name: Gather Clusters When No Datacenters Were Provided
when: not info_datacenters
block:
- name: Get clusters
vmware.vmware_rest.vcenter_cluster_info:
vcenter_hostname: "{{ info_hostport }}"
vcenter_username: "{{ info_username }}"
vcenter_password: "{{ info_password }}"
vcenter_validate_certs: "{{ info_validate_certs | default(omit) }}"
register: __clusters
tags:
- cluster
- name: Get cluster info
vmware.vmware.cluster_info:
hostname: "{{ info_hostname }}"
username: "{{ info_username }}"
password: "{{ info_password }}"
port: "{{ info_port | d(omit) }}"
validate_certs: "{{ info_validate_certs | default(omit) }}"
cluster: "{{ _cluster_name }}"
schema: vsphere
properties:
- name
- configuration.dasConfig.enabled
- summary.totalCpu
loop: "{{ __clusters.value }}"
loop_control:
loop_var: _cluster_name
register: __clusters_info
tags:
- cluster

- name: Get cluster info
community.vmware.vmware_cluster_info:
hostname: "{{ info_hostname }}"
username: "{{ info_username }}"
password: "{{ info_password }}"
port: "{{ info_port | d(omit) }}"
validate_certs: "{{ info_validate_certs | default(omit) }}"
cluster_name: "{{ item.name }}"
schema: vsphere
properties:
- name
- configuration.dasConfig.enabled
- summary.totalCpu
loop: "{{ __clusters.value }}"
register: __clusters_info
tags:
- cluster
- name: Gather Clusters When Datacenters Were Provided
when: info_datacenters
block:
- name: Get cluster info
vmware.vmware.cluster_info:
hostname: "{{ info_hostname }}"
username: "{{ info_username }}"
password: "{{ info_password }}"
port: "{{ info_port | d(omit) }}"
validate_certs: "{{ info_validate_certs | default(omit) }}"
datacenter: "{{ _dc_name }}"
schema: vsphere
properties:
- name
- configuration.dasConfig.enabled
- summary.totalCpu
loop: "{{ info_datacenters }}"
loop_control:
loop_var: _dc_name
register: __clusters_info
tags:
- cluster

- name: Write Cluster Results To File
when: info_cluster_file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
- name: Post-Deployment Validation
block:
- name: Retrieve Cluster Info
community.vmware.vmware_cluster_info:
vmware.vmware.cluster_info:
hostname: "{{ vmware_ops_hostname }}"
username: "{{ vmware_ops_username }}"
password: "{{ vmware_ops_password }}"
Expand All @@ -33,7 +33,7 @@
- name: Check DRS Settings for Cluster
ansible.builtin.assert:
that:
- "cluster_info.clusters[cluster_settings_cluster_name].enabled_drs == cluster_settings_drs_enable"
- "cluster_info.clusters[cluster_settings_cluster_name].drs_enabled == cluster_settings_drs_enable"
- "cluster_info.clusters[cluster_settings_cluster_name].drs_default_vm_behavior == cluster_settings_drs_enable_vm_behavior"
- "cluster_info.clusters[cluster_settings_cluster_name].drs_vmotion_rate == cluster_settings_drs_vmotion_rate"
quiet: true
Expand All @@ -43,7 +43,7 @@
- name: Check HA Settings for Cluster
ansible.builtin.assert:
that:
- "cluster_info.clusters[cluster_settings_cluster_name].enable_ha == cluster_settings_ha_enable"
- "cluster_info.clusters[cluster_settings_cluster_name].ha_enabled == cluster_settings_ha_enable"
- "cluster_info.clusters[cluster_settings_cluster_name].ha_host_monitoring == cluster_settings_ha_host_monitoring"
- "cluster_info.clusters[cluster_settings_cluster_name].ha_vm_monitoring == cluster_settings_ha_vm_monitoring"
quiet: true
Expand All @@ -53,7 +53,7 @@
- name: Check vSAN Settings for Cluster
ansible.builtin.assert:
that:
- "cluster_info.clusters[cluster_settings_cluster_name].enabled_vsan == cluster_settings_vsan_enable"
- "cluster_info.clusters[cluster_settings_cluster_name].vsan_enabled == cluster_settings_vsan_enable"
- "cluster_info.clusters[cluster_settings_cluster_name].vsan_auto_claim_storage == cluster_settings_vsan_auto_claim_storage"
quiet: true
fail_msg: "vSAN settings are not configured correctly for {{ cluster_settings_cluster_name }}."
Expand Down
Loading