diff --git a/changelogs/fragments/9646-hpilo-fix-idempotency.yml b/changelogs/fragments/9646-hpilo-fix-idempotency.yml new file mode 100644 index 00000000000..099cb84f8eb --- /dev/null +++ b/changelogs/fragments/9646-hpilo-fix-idempotency.yml @@ -0,0 +1,2 @@ +minor_changes: + - "hpilo_boot - Fix module failing when trying to power on an already powered-on server (idempotency issue) (https://github.com/ansible-collections/community.general/pull/9646)." \ No newline at end of file diff --git a/plugins/modules/hpilo_boot.py b/plugins/modules/hpilo_boot.py index ecef60f66a2..b49a76ad32f 100644 --- a/plugins/modules/hpilo_boot.py +++ b/plugins/modules/hpilo_boot.py @@ -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