HewlettPackard / oneview-ansible

This project is no longer being developed and has limited support. Please use the newer Ansible Collection project: https://github.com/HewlettPackard/oneview-ansible-collection
Apache License 2.0
104 stars 65 forks source link

Server maintenance mode #599

Closed avgovind closed 3 years ago

avgovind commented 3 years ago

Scenario/Intent

OneView 5.2 introduced ability to put servers in Maintenance mode to stop server alerts going to Activities and SCMB. One of the customers is asking for ability to set the maintenance mode through Ansible playbooks. Request to add this support in the Ansible library and update the examples.

Environment Details

Steps to Reproduce

NA

Expected Result

Change server state from Maintenance mode Disable to Enable

Actual Result

Could not find a way to set maintenance mode using the present Ansible-OneView library.

AsisBagga commented 3 years ago

@avgovind Hi Govind, we are looking into this, ill update you once we have this updated in our library.

avgovind commented 3 years ago

Thank you very much for adding this enhancement request. I am going to try soon and close this issue.

avgovind commented 3 years ago

I got the code from pull request and tried using the following playbook on OneView 5.4 (it failed with API version 1200 and works only when I set to 2000):

- hosts: localhost
  tasks:
  - name: Enable Server Maintenance Mode
    oneview_server_hardware:
      hostname: 10.x.y.z
      username: administrator
      password: password
      api_version: 2000
      state: enable_maintenance_mode
      data:
          name : 'ILOMXQ91002T3.v1000.cce01.presales.hpecorp.net'
    delegate_to: localhost

Can you please merge to main branch so that the customer can access the changes?