HewlettPackard / ilo-ansible-collection

Ansible Collection and Sample Playbooks for HPE iLO
Apache License 2.0
40 stars 20 forks source link

CreateSNMPAlertDestinations IP address validation check removal or adjustment for the variable to accept FQDN string #30

Open MoSXaR opened 4 months ago

MoSXaR commented 4 months ago

Hi everyone.

Trying to set the SNMP alert destinations as FQDN (which is supported to work in iLO versions 4, 5, 6, as I can successfully set it at the iLO) I get the error: FAILED! => {"changed": false, "msg": "Invalid IP address : [the variable I set as FQDN] "}.

I see that "ilo_oem_utils.py" at line 2263 validates the input dictionary variable alert_destinations (particularly the sub-variable alert_destination) using the "validate_alert_destinations" function (lines 2300-2325).

Similarly, I see that "create_snmp_alert_destinations.py" at lines 245-248 validates the variable alert_destination again as IP and throws the encountered exception in case the variable is a FQDN string.

Could you please modify the code so that the validation checks accept also FQDN, as is the case with iLO versions 4, 5, 6 ?

Execution environment created in Ansible Automation Platform with the respective requirements.yml (paramiko v.2.8.1, certifi v2024.2.2) and requirements.txt (python-ilo-rest-library v4.8.0.0) as well as hpe.ilo v1.0.35 and community.general v8.4.0).

Thanks.