fix: fix hpilo_boot.py module failing when trying to power on an already powered-on server

For this module to be idempotent, it should be successful when trying to reach a power state which is already there.

It was already the case for "poweroff", however when running the module with "boot_once" state, it was failing if the server was already powered_on, which is not an idempotent behavior
This commit is contained in:
Ryan BADAÏ 2025-01-28 10:44:43 +01:00 committed by GitHub
parent 8749da7756
commit 02616ec6b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -188,9 +188,8 @@ def main():
power_status = ilo.get_host_power_status()
if not force and power_status == 'ON':
module.fail_json(msg='HP iLO (%s) reports that the server is already powered on !' % host)
if power_status == 'ON':
pass
elif power_status == 'ON':
ilo.warm_boot_server()
# ilo.cold_boot_server()
changed = True