Open kotireddy478 opened 1 year ago
Files identified in the description:
If these files are incorrect, please update the component name
section of the description or use the !component
bot command.
cc @bhavya06 @mraineri @rajeevkallur @renxulei @tomasg2012 @xmadsen click here for bot help
Running the same request with a stripped down playbook seems to work okay for me. Will need to experiment with your exact playbook.
I also see you're using an older version of the module; would you be able to try the latest version (6.2)?
Here's my reduced playbook for reference:
---
- hosts: all
gather_facts: false
vars:
username: <REDACTED>
password: <REDACTED>
baseuri: <REDACTED>
default_uri_timeout: 40
default_uri_retries: 5
attribute_value: <REDACTED>
tasks:
- name: Set Manager NIC
community.general.redfish_config:
category: Manager
command: SetManagerNic
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
nic_config:
HostName: "{{ attribute_value }}"
retries: "{{ default_uri_retries }}"
timeout: "{{ default_uri_timeout }}"
register: redfish_results
- debug:
var: redfish_results
Downgraded on my end to 4.8.1 and the above playbook still works... Will keep digging...
Still not recreating the issue with this playbook:
---
- hosts: all
name: Configure HostName
gather_facts: False
# vars_files: iLO_redfish.yml
vars:
- attribute_name: HostName
- attribute_value: <REDACTED>
- username: <REDACTED>
- password: <REDACTED>
- baseuri: <REDACTED>
tasks:
- name: Create session
community.general.redfish_command:
category: Sessions
command: CreateSession
baseuri: "{{ baseuri }}"
username: "{{ username }}"
password: "{{ password }}"
register: result
- name: Set Manager NIC
community.general.redfish_config:
category: Manager
command: SetManagerNic
nic_config:
HostName: "{{ attribute_value }}"
baseuri: "{{ baseuri }}"
# username: "{{ username }}"
# password: "{{ password }}"
auth_token: "{{ result.session.token }}"
- name: Delete session using security token created by CreateSesssion above
community.general.redfish_command:
category: Sessions
command: DeleteSession
baseuri: "{{ baseuri }}"
auth_token: "{{ result.session.token }}"
session_uri: "{{ result.session.uri }}"
Hi - Thanks for all investigation.
I tried with latest version (6.2) but it's also failing.
Little bit of background info:
We have a host called pp-ilo-ilo1.example.com and our Ansible inventory hostname is also the same. To test host renaming, we changed the hostname to pp-ilo-ilo6.example.com and running the playbook to rename back to pp-ilo-ilo1.example.com but unfortunately it's not working. Ansible inventory with ilo ip address working but not host name. I hope it makes sense to you.
Thanks
Still not recreating the issue with this playbook:
--- - hosts: all name: Configure HostName gather_facts: False # vars_files: iLO_redfish.yml vars: - attribute_name: HostName - attribute_value: <REDACTED> - username: <REDACTED> - password: <REDACTED> - baseuri: <REDACTED> tasks: - name: Create session community.general.redfish_command: category: Sessions command: CreateSession baseuri: "{{ baseuri }}" username: "{{ username }}" password: "{{ password }}" register: result - name: Set Manager NIC community.general.redfish_config: category: Manager command: SetManagerNic nic_config: HostName: "{{ attribute_value }}" baseuri: "{{ baseuri }}" # username: "{{ username }}" # password: "{{ password }}" auth_token: "{{ result.session.token }}" - name: Delete session using security token created by CreateSesssion above community.general.redfish_command: category: Sessions command: DeleteSession baseuri: "{{ baseuri }}" auth_token: "{{ result.session.token }}" session_uri: "{{ result.session.uri }}"
To replicate this try changing hostname from ILOSGH924TZ37 to a name say ILOSGH924TZ38 and then try to change back to ILOSGH924TZ37. You will see the error we were getting. Please let me know if you need any additional info.
Thanks; I'll see if I can track down an HPE system. Maybe it's an issue where the request is failing, and is exposing a bug in the module. If I can't find an HPE system I might be able to set up a mockup and force errors and other issues that could trigger the exception...
cc @TSKushal click here for bot help
cc @jyundt click here for bot help
@kotireddy478 sorry about the delay for digging further into this; I was able to access an HPE system and still not able to recreate the issue... I can attempt to create mockups to force various error paths as a next step to see what could be going on... If that's not successful, would you be willing to run things out of a debug branch to trace down what's happening for you?
I was also able to stimulate an error path with a bad hostname, but it looks like it's being handled properly:
TASK [Set Manager NIC] *******************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "msg": "HTTP Error 400 on PATCH request to 'https://<REDACTED>/redfish/v1/Managers/1/EthernetInterfaces/1/', extended message: '[{'MessageArgs': ['<REDACTED>', 'HostName'], 'MessageId': 'Base.1.4.PropertyValueFormatError'}]'"}
And for clarity... In the baseuri
field of the playbook, are you using the IP address of the iLO or something else?
+1 with community.general 8.5.0 cannot set hostname on hpe gen11 either also see: https://github.com/HewlettPackard/ilo-ansible-collection/issues/22
Summary
Hi,
I'm trying to configure ilo hostname using redfish config in https://github.com/HewlettPackard/ilo-ansible-collection/blob/main/roles/playbooks/Manager/config_hostname.yml but i'm getting below error. Could you please help?
Thanks
Issue Type
Bug Report
Component Name
community.general.redfish_config
Ansible Version
Community.general Version
Configuration
OS / Environment
CentOS 7
Steps to Reproduce
Expected Results
I expected hostname removed to passed var
Actual Results
Code of Conduct