Original Message:
Sent: Thu February 08, 2024 08:30 AM
From: Steve Munday
Subject: ANSIBLE powervm_inventory
Evangelos,
Hi, I just tried to connect to an invalid HMC and get the following:
[WARNING]: Unable to connect to HMC host {'hmc': 'hmc-name', 'user':'user-name', 'password': 'pass-word'}: URLError(TimeoutError(78,'Connection timed out'))
Re-check HMC name(s) and user/password details to see if there's a typo in there somewhere.
Also, have you tried running the command with -vvv at the end to get a more detailed debug?
Thanks, Steve
------------------------------
Steve Munday
AIX, IBM i, HMC, PowerVM
------------------------------
Original Message:
Sent: Thu February 08, 2024 07:31 AM
From: Steve Munday
Subject: ANSIBLE powervm_inventory
Evangelos,
Hi, are you able to successfully SSH to your target HMC from your Control Node using the credentials you've defined in the playbook? Also, is the "user" on the HMC allowed to connect remotely?
Thanks, Steve
------------------------------
Steve Munday
AIX, IBM i, HMC, PowerVM
Original Message:
Sent: Thu February 08, 2024 07:00 AM
From: EVANGELOS VARTHALAMIS
Subject: ANSIBLE powervm_inventory
Hello Steve,
Thank you for your response. I downloaded lxml for python 3.11 and installed it.
Also added the lines in ansible.cfg file
The error now is the following :
[WARNING]: Unable to connect to HMC host {'hmc': 'hostname', 'user': 'user', 'password': 'pass'}: URLError(TimeoutError(110, 'Connection timed out'))
[WARNING]: * Failed to parse /home/ansible/myhmc.power_hmc.yaml with auto plugin: There are no systems defined to any valid HMCs provided or no valid
connections were established.
[WARNING]: * Failed to parse /home/ansible/myhmc.power_hmc.yaml with yaml plugin: Plugin configuration YAML file, not YAML inventory
[WARNING]: * Failed to parse /home/ansible/myhmc.power_hmc.yaml with ini plugin: Invalid host pattern 'plugin:' supplied, ending in ':' is not allowed,
this character is reserved to provide a port.
[WARNING]: * Failed to parse /home/ansible/myhmc.power_hmc.yaml with ansible_collections.ibm.power_hmc.plugins.inventory.powervm_inventory plugin: There
are no systems defined to any valid HMCs provided or no valid connections were established.
[WARNING]: Unable to parse /home/ansible/myhmc.power_hmc.yaml as an inventory source
[WARNING]: No inventory was parsed, only implicit localhost is available
{
"_meta": {
"hostvars": {}
},
"all": {
"children": [
"ungrouped"
]
}
}
------------------------------
EVANGELOS VARTHALAMIS
Original Message:
Sent: Thu February 08, 2024 04:31 AM
From: Steve Munday
Subject: ANSIBLE powervm_inventory
Evangelos,
Hi, good day to you.
I found that the following needed to be installed first.
dnf install libxml2-devel libxslt-devel python3-devel gcc
In addition, as you have mentioned, lxml is also required.
python3 -m pip install lxml
And finally, you will need to add "ibm.power_hmc.powervm_inventory" to both the "enable inventory plugins" and "enable_plugins" lines in ansible.cfg
[inventory]enable inventory plugins, default: 'host_list', 'script', 'auto', 'yaml', 'ini', 'toml', 'ibm.power_hmc.powervm_inventory'enable_plugins = host_list, script, auto, yaml, ini, toml, ibm.power_hmc.powervm_inventory
Once I'd completed the above I was then able to generate a dynamic inventory.
Hope that helps.
Regards, Steve
------------------------------
Steve Munday
AIX, IBM i, HMC, PowerVM