dell/redfish-ansible-module

HTTP Error: 404

feisa opened this issue · 12 comments

feisa commented

When attempting to gather facts on an r630 we receive the following
"manager_attributes": {
"msg": "HTTP Error: 404",
"ret": false

But an r640 returns the correct values, manager_attributes

Can you provide the API call that you issued that resulted in this error?

feisa commented
  • name: Enable NTP
    redfish_config:
    category: Manager
    command: SetManagerAttributes
    mgr_attr_name: NTPConfigGroup.1.NTPEnable
    mgr_attr_value: Enabled
    baseuri: "{{ baseuri }}"
    user: "{{ user}}"
    password: "{{ password }}"

  • name: Configure Anycast NTP
    redfish_config:
    category: Manager
    command: SetManagerAttributes
    mgr_attr_name: NTPConfigGroup.1.NTP1
    mgr_attr_value: 10.255.255.2
    baseuri: "{{ baseuri }}"
    user: "{{ user}}"
    password: "{{ password }}"

  • name: Configure Backup NTP Source
    redfish_config:
    category: Manager
    command: SetManagerAttributes
    mgr_attr_name: NTPConfigGroup.1.NTP2
    mgr_attr_value: 10.5.250.88
    baseuri: "{{ baseuri }}"
    user: "{{ user}}"
    password: "{{ password }}"

  • name: Configure Time Zone
    redfish_config:
    category: Manager
    command: SetManagerAttributes
    mgr_attr_name: Time.1.Timezone
    mgr_attr_value: EST5EDT
    baseuri: "{{ baseuri }}"
    user: "{{ user}}"
    password: "{{ password }}"

The SetManageAttributes command was taken out of the redfish_config module because it used non-standard Redfish APIs. I am in process of submit a PR for a new module idrac_redfish_config that implements Dell-specific Redfish APIs to set iDRAC parameters. It will live in the modules/remote_management/dellemc/idrac directory.

feisa commented

That's great news, any timeline? Let me know if you need a alpha/beta tester.

feisa commented

/redfish/v1/Managers/iDRAC.Embedded.1/Attributes', extended message: 'Unable to complete the operation because the resource ~~Attributes~ entered in not found.'"}

Thats my error now

feisa commented

using the same role from above with the modified module and username parameter change from user to username

feisa commented

also receive the following on some machines

The full traceback is:
Traceback (most recent call last):
File "/home/feisa/.ansible/tmp/ansible-tmp-1555612540.26-66054509063816/AnsiballZ_idrac_redfish_config.py", line 113, in
_ansiballz_main()
File "/home/feisa/.ansible/tmp/ansible-tmp-1555612540.26-66054509063816/AnsiballZ_idrac_redfish_config.py", line 105, in _ansiballz_main
invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
File "/home/feisa/.ansible/tmp/ansible-tmp-1555612540.26-66054509063816/AnsiballZ_idrac_redfish_config.py", line 48, in invoke_module
imp.load_module('main', mod, module, MOD_DESC)
File "/tmp/ansible_idrac_redfish_config_payload_OKXEhp/main.py", line 220, in
File "/tmp/ansible_idrac_redfish_config_payload_OKXEhp/main.py", line 188, in main
TypeError: init() takes exactly 3 arguments (4 given)

fatal: [idrac-ch1-splkx001]: FAILED! => {
"changed": false,
"module_stderr": "Traceback (most recent call last):\n File "/home/feisa/.ansible/tmp/ansible-tmp-1555612540.26-66054509063816/AnsiballZ_idrac_redfish_config.py", line 113, in \n _ansiballz_main()\n File "/home/feisa/.ansible/tmp/ansible-tmp-1555612540.26-66054509063816/AnsiballZ_idrac_redfish_config.py", line 105, in _ansiballz_main\n invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n File "/home/feisa/.ansible/tmp/ansible-tmp-1555612540.26-66054509063816/AnsiballZ_idrac_redfish_config.py", line 48, in invoke_module\n imp.load_module('main', mod, module, MOD_DESC)\n File "/tmp/ansible_idrac_redfish_config_payload_OKXEhp/main.py", line 220, in \n File "/tmp/ansible_idrac_redfish_config_payload_OKXEhp/main.py", line 188, in main\nTypeError: init() takes exactly 3 arguments (4 given)\n",
"module_stdout": "",
"msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
"rc": 1


  • name: Configure Anycast DNS Settings
    idrac_redfish_config:
    category: Manager
    command: SetManagerAttributes
    manager_attribute_name: IPv4Static.1.DNS1
    manager_attribute_value: 10.255.255.1
    baseuri: "{{ baseuri }}"
    username: "{{ user}}"
    password: "{{ password }}"

  • name: Configure Statuc DNS Settings
    idrac_redfish_config:
    category: Manager
    command: SetManagerAttributes
    manager_attribute_name: IPv4Static.1.DNS2
    manager_attribute_value: 10.5.250.24
    baseuri: "{{ baseuri }}"
    username: "{{ user}}"
    password: "{{ password }}"

  • name: Configure Domain Name
    idrac_redfish_config:
    category: Manager
    command: SetManagerAttributes
    manager_attribute_name: NICStatic.1.DNSDomainName
    manager_attribute_value: hq.crabel.com
    baseuri: "{{ baseuri }}"
    username: "{{ user}}"
    password: "{{ password }}"

@feisa, Couple of things. First, make sure you are running at least Ansible v2.8. Second, note that updating Manager attributes is only available in 14G server. Here is my output, running on one R740 (red4) and one R630 server:

$ cat set_manager_dns.yml
---
- hosts: myhosts
  connection: local
  name: Set Manager network settings
  gather_facts: False

  tasks:

  - name: Configure Static DNS Settings
    idrac_redfish_config:
      category: Manager
      command: SetManagerAttributes
      manager_attribute_name: IPv4Static.1.DNS1
      manager_attribute_value: 100.71.103.10
      baseuri: "{{ baseuri }}"
      username: "{{ username }}"
      password: "{{ password }}"

  - name: Configure Domain Name
    idrac_redfish_config:
      category: Manager
      command: SetManagerAttributes
      manager_attribute_name: NICStatic.1.DNSDomainName
      manager_attribute_value: oseadc.local
      baseuri: "{{ baseuri }}"
      username: "{{ username }}"
      password: "{{ password }}"

$ ansible-playbook set_manager_dns.yml
 [WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to see
details


PLAY [Set Manager network settings] ********************************************************

TASK [Configure Static DNS Settings] *******************************************************
Tuesday 23 April 2019  12:25:51 -0500 (0:00:00.077)       0:00:00.077 *********
ok: [red4]
fatal: [r630]: FAILED! => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "HTTP Error 404 on GET request to 'https://idrac-r630/redfish/v1/Managers/iDRAC.Embedded.1/Attributes', extended message: 'Unable to complete the operation because the resource Attributes entered in not found.'"}

TASK [Configure Domain Name] ***************************************************************
Tuesday 23 April 2019  12:25:55 -0500 (0:00:04.125)       0:00:04.202 *********
changed: [red4]

PLAY RECAP *********************************************************************************
r630                       : ok=0    changed=0    unreachable=0    failed=1    skipped=0    rescued=0    ignored=0
red4                       : ok=2    changed=1    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0

Tuesday 23 April 2019  12:25:57 -0500 (0:00:02.393)       0:00:06.596 *********
===============================================================================
Configure Static DNS Settings ------------------------------------------------------- 4.13s
Configure Domain Name --------------------------------------------------------------- 2.39s
Playbook run took 0 days, 0 hours, 0 minutes, 6 seconds

feisa commented

That helps with my issues thanks.

I see this using redfish_config on a 13G server

{"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "msg": "Unsupported parameters for (redfish_config) module: mgr_attr_name, mgr_attr_value, user Supported parameters include: baseuri, bios_attribute_name, bios_attribute_value, category, command, password, timeout, username"}

@feisa, So does this address your issue and we can close it?

feisa commented

yes we can close it