community.general icon indicating copy to clipboard operation
community.general copied to clipboard

hpiLo_boot force should be exclusive with poweroff

Open jhg03a opened this issue 3 years ago • 8 comments

Summary

While using the hpiLo_boot module, I was trying to force the system power off. I made the mistake of setting both the force argument and the state of poweroff. The behavior in this case is counter to what I'd expect; rebooting instead of powering off. The force flag should either throw an error with the state poweroff, or just ignore the force flag in this case.

Issue Type

Feature Idea

Component Name

hpilo_boot

Additional Information

- hosts: localhost
  connection: local
  gather_facts: no

  vars:
    baseuri: iloIP
    username: foo
    password: bar

  tasks:
  - name: Force the system off in case it's stuck in POST
    hpilo_boot:
      host: "{{ baseuri }}"
      login: "{{ username }}"
      password: "{{ password }}"
      state: poweroff
      force: true

Code of Conduct

  • [X] I agree to follow the Ansible Code of Conduct

jhg03a avatar Apr 19 '21 20:04 jhg03a

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Apr 19 '21 20:04 ansibullbot

cc @MorrisA @bcoca @d-little @flynn1973 @gforster @haad @kairoaraujo @marvin-sinister @mator @molekuul @mulby @ramooncamacho @wtcross click here for bot help

ansibullbot avatar Apr 19 '21 20:04 ansibullbot

https://github.com/ansible-collections/community.general/blob/b10d707a8baa2530deb98a218c820762a2ce879a/plugins/modules/remote_management/hpilo/hpilo_boot.py#L173

jhg03a avatar Apr 19 '21 20:04 jhg03a

@jhg03a Thanks for reporting this. You could submit a PR to fix the issue - we would be more than happy to review it. Else, it will have to wait for someone to pick it up.

russoz avatar Apr 19 '21 21:04 russoz

!component =plugins/modules/remote_management/hpilo/hpilo_boot.py

felixfontein avatar Apr 20 '21 04:04 felixfontein

Please note that this must not be simply changed (both ignoring the flag, or erroring out is a change in behavior). The current behavior needs to be deprecated, as there might be users which depend on it, and only changed in +2 major versions.

felixfontein avatar Apr 20 '21 04:04 felixfontein

Files identified in the description:

If these files are inaccurate, please update the component name section of the description or use the !component bot command.

click here for bot help

ansibullbot avatar Apr 20 '21 04:04 ansibullbot

cc @dagwieers click here for bot help

ansibullbot avatar Nov 03 '22 01:11 ansibullbot