setup module returns no hw-info on AIX VIOS.
we run some playbooks against AIX servers. To complete the picture, we decided to also use ansible vor VIO servers.
All AIX servers includings VIOs have python 3.9.16 installed!
We gather facts from all servers using the setup module and save these to files on a central node, where we produce excel sheets from these facts.
This works well for standard AIX (7.2 or 7.3), but we do not see hardware related facts for vio servers.
Here is a code snippet:
- name: "Get facts from server"
setup:
gather_subset:
- 'hardware'
- 'network'
- 'virtual'
- '!facter'
- '!ohai'
- name: "save to local file"
copy:
content: "{{ ansible_facts }}"
dest: "{{ factfile }}"
mode: '0644'
delegate_to: "{{ factfile_host }}"
become: no
```
I tried to look into the python code and also added a number of print statements in /usr/lib/python3.9/site-packages/ansible/module_utils/facts/hardware/aix.py
```
def get_dmi_facts(self):
dmi_facts = {}
rc, out, err = self.module.run_command("/usr/sbin/lsattr -El sys0 -a fwversion")
data = out.split()
dmi_facts['firmware_version'] = data[1].strip('IBM,')
lsconf_path = self.module.get_bin_path("lsconf")
print("# lsconf_path", lsconf_path)
if lsconf_path:
rc, out, err = self.module.run_command(lsconf_path)
if rc == 0 and out:
print("# out", out)
for line in out.splitlines():
data = line.split(':')
if 'Machine Serial Number' in line:
dmi_facts['product_serial'] = data[1].strip()
print("# prod_ser:", dmi_facts['product_serial'])
if 'LPAR Info' in line:
dmi_facts['lpar_info'] = data[1].strip()
if 'System Model' in line:
dmi_facts['product_name'] = data[1].strip()
print("## dmi_facts:", dmi_facts)
return dmi_facts
```
The ouput show my print statements, which prove, that the OS-commands are ran correctly from the modified code, but the resulting facts, that are returned, do not contain the infos.
My python/ansible skills end here. Can anyone provides some help. Would be much appreciated!