HewlettPackard / oneview-ansible

This project is no longer being developed and has limited support. Please use the newer Ansible Collection project: https://github.com/HewlettPackard/oneview-ansible-collection
Apache License 2.0
104 stars 65 forks source link

Ansible yml blocked by Legal Notice setting in HPE OneView #360

Closed rendeluitjes closed 5 years ago

rendeluitjes commented 6 years ago

Scenario/Intent

Performing basic OneView interaction with the framework.

Environment Details

Steps to Reproduce

Verify that the targeted HPE OneView Appliance has "Banner content must be acknowledged before logging in" Setting enabled.

Followed by: ansible-playbook -i hosts oneview_version_facts.yml

Expected Result

Does work when disabling legal banner but should work.

Actual Result

Receive a ansible trace with a repeated dialog around the Legal notice message, not getting the requested information back: TASK [Gather facts about current and minimum Version] ***** An exception occurred during task execution. To see the full traceback, use -vvv. The error was: hpOneView.exceptions.HPOneViewException: ('Acknowledgment of login message is required. Message:You have logged on to a xxx network element. Use of this system/network is restricted to authorized xxx personnel. The software and data in this system/network are owned by xxx and may be viewed, changed, copied or deleted only by authorized persons for the purpose of their work for KPxxxN. .', {'errorSource': None, 'nestedErrors': [], 'details': 'Acknowledgment of the login message is required.', 'recommendedActions': ['Acknowledge login message by setting loginMsgAck attribute to true and try again.'], 'data': {}, 'errorCode': 'AUTHN_LOGIN_MESSAGE_ACKNOWLEDGMENT_REQUIRED', 'message': 'Acknowledgment of login message is required. Message:You have logged on to a xx network element. Use of this system/network is restricted to authorized xxx personnel. The software and data in this system/network are owned by xxx and may be viewed, changed, copied or deleted only by authorized persons for the purpose of their work for xxx. .'}) fatal: [localhost -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_w0qn4frq/ansible_module_oneview_version_facts.py\", line 71, in \n main()\n File \"/tmp/ansible_w0qn4frq/ansible_module_oneview_version_facts.py\", line 67, in main\n VersionFactsModule().run()\n File \"/tmp/ansible_w0qn4frq/ansible_module_oneview_version_facts.py\", line 58, in init\n super(VersionFactsModule, self).init(additional_arg_spec=dict())\n File \"/tmp/ansible_w0qn4frq/ansible_modlib.zip/ansible/module_utils/oneview.py\", line 360, in init\n self._create_oneview_client()\n File \"/tmp/ansible_w0qn4frq/ansible_modlib.zip/ansible/module_utils/oneview.py\", line 400, in _create_oneview_client\n self.oneview_client = OneViewClient.from_json_file(self.module.params['config'])\n File \"/usr/lib/python3.6/site-packages/hpOneView/oneview_client.py\", line 214, in from_json_file\n return cls(config)\n File \"/usr/lib/python3.6/site-packages/hpOneView/oneview_client.py\", line 124, in init\n self.__connection.login(config[\"credentials\"])\n File \"/usr/lib/python3.6/site-packages/hpOneView/connection.py\", line 458, in login\n task, body = self.post(uri['loginSessions'], self._cred)\n File \"/usr/lib/python3.6/site-packages/hpOneView/connection.py\", line 377, in post\n return self.do_rest_call('POST', uri, body, custom_headers=custom_headers)\n File \"/usr/lib/python3.6/site-packages/hpOneView/connection.py\", line 404, in do_rest_call\n raise HPOneViewException(body)\nhpOneView.exceptions.HPOneViewException: ('Acknowledgment of login message is required. Message:You have logged on to a xxx network element. Use of this system/network is restricted to authorized xxx personnel. The software and data in this system/network are owned by xxx and may be viewed, changed, copied or deleted only by authorized persons for the purpose of their work for xxx. .', {'errorSource': None, 'nestedErrors': [], 'details': 'Acknowledgment of the login message is required.', 'recommendedActions': ['Acknowledge login message by setting loginMsgAck attribute to true and try again.'], 'data': {}, 'errorCode': 'AUTHN_LOGIN_MESSAGE_ACKNOWLEDGMENT_REQUIRED', 'message': 'Acknowledgment of login message is required. Message:You have logged on to a xxx network element. Use of this system/network is restricted to authorized xxx personnel. The software and data in this system/network are owned by xxx and may be viewed, changed, copied or deleted only by authorized persons for the purpose of their work for xxx. .'})\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 1}

sijeesh commented 5 years ago

@rendeluitjes, set "require acknowledge" flag to "No' from loging tab under settings.

Closing this issue, feel free to reopen if it's not solving your issue.