BCDevOps / developer-experience

This repository is used to track all work for the BCGov Platform Services Team (This includes work for: 1. Platform Experience, 2. Developer Experience 3. Platform Operations/OCP 3)
Apache License 2.0
8 stars 17 forks source link

Create an Ansible Automation Platform play that checks the ILO/iDRAC logins and virtual nics #4114

Closed tbaker1313 closed 1 month ago

tbaker1313 commented 1 year ago

Describe the issue Create and document an Ansible Automation Platform play that checks the ILO/iDRAC logins and virtual nics.

Proposed checks

How does this benefit the users of our platform?

Definition of done

vivekratan88 commented 2 months ago

Reference links : https://github.com/HewlettPackard/ilo-ansible-collection https://docs.ansible.com/ansible/latest/collections/community/general/hpilo_info_module.html

The REST Redfish API should be enabled

https://www.hpe.com/ca/en/servers/restful-api.html

pseudo code is like

name: ilo login hosts:

vars: ilo_ip: ilo_username: ilo_pass: ilo_logurl:"

tasks: -name: retrive logins uri: url:"https://{{ilo_ip}}{{ilo_logurl}}" there is more code for sure will have to look into it
register: ilologresponse then use debug and var ilologresponse

use selectattr to filter what you need

make a loop and display those log events

tbaker1313 commented 2 months ago

To disable the Virtual nic, more info is found in this HPE forum https://community.hpe.com/t5/server-management-remote-server/disable-ilo-virtual-nic/td-p/7087994 I'll be something like this:

PATCH /redfish/v1/Managers/{managerId}/

{

    "Oem": {

        "Hpe": {

            "VirtualNICEnabled": false

        }

    }

}

For ansible, this ends up looking similar to this:

  name: Turn off the virtual NIC if necessary
  uri:
    url: 'https://{{ uri }}/redfish/v1/Managers/1/'
    method: PATCH
    body:
      Oem:
        Hpe:
          VirtualNICEnabled: false
    body_format: json
    headers:
      Content-Type: application/json
  register: result
tbaker1313 commented 1 month ago

Ran some tests, discovered that depending on the Instance environment, different servers are either available or not. Was able to determine that it was possible to check the logins (particularly for the DELL servers, HPE was somewhat inconclusive.) We really need another test on a Gen 10 which will be accomplished the week of September 23rd.

tbaker1313 commented 1 month ago

Completed, tested and AAP template updated to use the master branch.