HewlettPackard / oneview-ansible-collection

Ansible Collection and Sample Playbooks for HPE OneView
Apache License 2.0
25 stars 22 forks source link

assign static IP addresses during LE creation #212

Closed vinicole closed 1 year ago

vinicole commented 1 year ago

Hello, I create this new issue since I can't re-open #86 which doesn't seem to be solved. The code fix proposed in issue #619 returns the following error with oneview-ansible-collection:

An exception occurred during task execution. To see the full traceback, use -vvv. The error was: hpeOneView.exceptions.HPEOneViewException: ('The JSON cannot be mapped to array or collection.', {'errorCode': 'INVALID_NESTED_JSON_ELEMENT', 'message': 'The JSON cannot be mapped to array or collection.', 'details': 'The nested JSON "enclosureBaySettings" sent in the request is not a valid array or collection.', 'messageParameters': [], 'recommendedActions': ['Correct the JSON as appropriate array or collection and retry the request.'], 'errorSource': None, 'nestedErrors': [], 'data': {}})

RHEL 8.6 Python 3.6.8 Ansible 2.9.27 Oneview-ansible-collection 7.2.0

Could you please have a look?

Thanks, V

Originally posted by @vinicole in https://github.com/HewlettPackard/oneview-ansible-collection/issues/86#issuecomment-1248150620

alisha-k-kalladassery commented 1 year ago

Hi Vinicole, We will check and get back to you on this.

alisha-k-kalladassery commented 1 year ago

Hi Vinicole,

We checked it from our end and it seems working fine. Could you please share the OV version which you are using and the playbook so that we can check further.

Eg:

- name: Create a Logical Enclosure (available only on HPE Synergy)
  oneview_logical_enclosure:
    config: "{{ config }}"
    sessionID: "{{ session.ansible_facts.session }}"
    state: present
    data:
      enclosureUris:
        - "{{ enclosures[1].uri }}"
        - "{{ enclosures[2].uri }}"
        - "{{ enclosures[0].uri }}"
      enclosureGroupUri: "{{ enclosure_groups['uri'] }}"
      name: "{{ contents.logical_enclosure.logical_enclosure_name }}"
      enclosureBaySettings:
        deviceBays:
          - enclosureNumber: 1
            bayNumber: 3
            manualAddresses:
              - type: "IPv4"
                ipAddress: "1.1.1.1"
          - enclosureNumber: 2
            bayNumber: 3
            manualAddresses:
              - type: "IPv4"
                ipAddress: "2.2.2.2"
        interconnectBays:
          - enclosureNumber: 1
            bayNumber: 2
            manualAddresses:
              - type: "IPv4"
                ipAddress: "3.3.3.3"
  ignore_errors: true
  delegate_to: localhost
  when: (contents.logical_enclosure.variant == "Synergy" and enclosures is not none and enclosures is not undefined and 
        enclosure_groups is not none and enclosure_groups is not undefined)
alisha-k-kalladassery commented 1 year ago

Hi Vinicole,

We are closing this issue as there is no reply from your end. Please feel free to open a new issue if you encounter any issues again.