Skip to content

Commit

Permalink
once more with feeling
Browse files Browse the repository at this point in the history
  • Loading branch information
acozine committed Oct 4, 2024
1 parent 132d50c commit 6654120
Showing 1 changed file with 58 additions and 58 deletions.
116 changes: 58 additions & 58 deletions playbooks/utils/vSphere_audit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,61 +96,61 @@
ansible.builtin.debug:
var: slim_GB_hash

# - name: View list of available templates
# ansible.builtin.debug:
# var: template_names

# - name: View list of ESXi hosts
# ansible.builtin.debug:
# var: esxi_hostnames

# - name: View memory usage per ESXi host
# ansible.builtin.debug:
# msg: The {{ item.0 }} host is using {{ ( item.1 | int * 1048576 ) | human_readable }} out of {{ item.2 | human_readable }} available memory.
# with_together:
# - "{{ slim_esxi_host_memory | map(attribute='Name') | list }}"
# - "{{ slim_esxi_host_memory | map(attribute='Usedmemory') | list }}"
# - "{{ slim_esxi_host_memory | map(attribute='Totalmemory') | list }}"

# - name: View number of VMs per ESXi host
# ansible.builtin.debug:
# msg:
# - The {{ item }} esxi_hostname contains {{ vm_info.virtual_machines | selectattr('esxi_hostname', 'equalto', item) | length }} VMs
# loop: "{{ esxi_hostnames }}"

# - name: get list of VMSANVOL storage nodes
# ansible.builtin.set_fact:
# general_purpose_storage_nodes: "{{ storage_nodes | select('search', '05TB') }}"

# - name: View storage node list
# ansible.builtin.debug:
# var: storage_nodes

# - name: View GP storage node list
# ansible.builtin.debug:
# var: general_purpose_storage_nodes

# - name: View storage info
# ansible.builtin.debug:
# var: storage_info

# - name: View free space per GP storage node
# ansible.builtin.debug:
# msg:
# - The {{ item }} storage node has {{ GB_hash.results[*].ansible_facts.storage_info_GB | selectattr('name', 'equalto', item) | map(attribute='GB_available') }} free space
# loop: "{{ general_purpose_storage_nodes }}"

# - name: Generate list of free space on all storage nodes
# ansible.builtin.debug:
# msg: The {{ item.0 }} node has {{ item.1 }} free space
# with_together:
# - "{{ GB_hash.results[*].ansible_facts.storage_info_GB | map(attribute='name') | list }}"
# - "{{ GB_hash.results[*].ansible_facts.storage_info_GB | map(attribute='GB_available') | list }}"
# ignore_errors: true

# - name: Generate sorted list of free space on all storage nodes
# ansible.builtin.debug:
# msg: The {{ item.0 }} node has {{ item.1 }} free space
# with_together:
# - "{{ GB_hash.results.ansible_facts.storage_info_GB | map(attribute='name') | list }}"
# - "{{ GB_hash.results.ansible_facts.storage_info_GB | map(attribute='GB_available') | list | sort }}"
- name: View list of available templates
ansible.builtin.debug:
var: template_names

- name: View list of ESXi hosts
ansible.builtin.debug:
var: esxi_hostnames

- name: View memory usage per ESXi host
ansible.builtin.debug:
msg: The {{ item.0 }} host is using {{ ( item.1 | int * 1048576 ) | human_readable }} out of {{ item.2 | human_readable }} available memory.
with_together:
- "{{ slim_esxi_host_memory | map(attribute='Name') | list }}"
- "{{ slim_esxi_host_memory | map(attribute='Usedmemory') | list }}"
- "{{ slim_esxi_host_memory | map(attribute='Totalmemory') | list }}"

- name: View number of VMs per ESXi host
ansible.builtin.debug:
msg:
- The {{ item }} esxi_hostname contains {{ vm_info.virtual_machines | selectattr('esxi_hostname', 'equalto', item) | length }} VMs
loop: "{{ esxi_hostnames }}"

- name: get list of VMSANVOL storage nodes
ansible.builtin.set_fact:
general_purpose_storage_nodes: "{{ storage_nodes | select('search', '05TB') }}"

- name: View storage node list
ansible.builtin.debug:
var: storage_nodes

- name: View GP storage node list
ansible.builtin.debug:
var: general_purpose_storage_nodes

- name: View storage info
ansible.builtin.debug:
var: storage_info

- name: View free space per GP storage node
ansible.builtin.debug:
msg:
- The {{ item }} storage node has {{ slim_GB_hash | selectattr('name', 'equalto', item) | map(attribute='Storage_available') }} free space
loop: "{{ general_purpose_storage_nodes }}"

- name: Generate list of free space on all storage nodes
ansible.builtin.debug:
msg: The {{ item.0 }} node has {{ item.1 }} free space
with_together:
- "{{ slim_GB_hash | map(attribute='name') | list }}"
- "{{ slim_GB_hash | map(attribute='Storage_available') | list }}"
ignore_errors: true

- name: Generate sorted list of free space on all storage nodes
ansible.builtin.debug:
msg: The {{ item.0 }} node has {{ item.1 }} free space
with_together:
- "{{ slim_GB_hash | map(attribute='name') | list }}"
- "{{ slim_GB_hash | map(attribute='GB_available') | list | sort }}"

0 comments on commit 6654120

Please sign in to comment.