dell / redfish-ansible-module

Ansible modules for Out-Of-Band Controllers using Redfish APIs
GNU General Public License v3.0
195 stars 80 forks source link

issue with running playbook #50

Closed aviv12825 closed 6 years ago

aviv12825 commented 6 years ago

Hi, I have an issue with running playbook ... any playbook. I follow the readme file but it seems something is missing. once running : "ansible-playbook get_firmware_inventory.yml" I get a fatal error - can you please tell what it means see below:
$ ansible-playbook get_firmware_inventory.yml [DEPRECATION WARNING]: The use of 'include' for tasks has been deprecated. Use 'import_tasks' for static inclusions or 'include_tasks' for dynamic inclusions. This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg. [DEPRECATION WARNING]: include is kept for backwards compatibility but usage is discouraged. The module documentation details page may explain more about this rationale.. This feature will be removed in a future release. Deprecation warnings can be disabled by setting deprecation_warnings=False in ansible.cfg.

PLAY [PowerEdge iDRAC Device Firmware Inventory] **

TASK [Define timestamp] *** ok: [localadmin]

TASK [Define file to place results] *** ok: [localadmin]

TASK [Create dropoff directory for host] ** ok: [localadmin -> localhost]

TASK [Get Firmware Inventory] ***** fatal: [localadmin]: FAILED! => {"msg": "The module idrac was not found in configured module paths. Additionally, core modules are missing. If this is a checkout, run 'git pull --rebase' to correct this problem."} ...ignoring

TASK [Copy inventory to file] ***** changed: [localadmin -> localhost]

PLAY RECAP **** localadmin : ok=5 changed=1 unreachable=0 failed=0

jose-delarosa commented 6 years ago

Hello, can you please let me know what Ansible version you are using? If you don't mind, please provide the output of:

$ ansible --version

Thanks

jose-delarosa commented 6 years ago

Also, the playbooks are meant to be run from the git tree, they should find the idrac module from their default directory (notice the 'library' symlink). This is not ideal, so I'm going to add an install script to copy the idrac module to the default Ansible module directories so that you can then run the playbooks from anywhere in your system.

aviv12825 commented 6 years ago

I must I solve it by put on ENV - the following: ANSIBLE_LIBRARY=/mnt/c/Users/aviv_graupen/Documents/idrac-ansible-module-master/module many of the playbook works , but others don't.. if you want I can share more information on the ones that don't .

as for the version: ansible 2.4.2.0 config file = None configured module search path = [u'/mnt/c/Users/aviv_graupen/Documents/idrac-ansible-module-master/module'] ansible python module location = /home/avivg/.local/lib/python2.7/site-packages/ansible executable location = /home/avivg/.local/bin/ansible python version = 2.7.12 (default, Dec 4 2017, 14:50:18) [GCC 5.4.0 20160609]

jose-delarosa commented 6 years ago
  1. Are you using cygwin on Windows? (I have only tested on Linux).
  2. What does your ansible hosts file look like?
  3. Yes please give me 1-2 examples of playbooks that are failing and please provide the part where it's failing,

Some playbooks will only work on 14G servers, but the module should detect the server model and fail with a proper message.

aviv12825 commented 6 years ago
  1. I'm using Win 10 with subsystem Linux inside it.

  2. my hosts file look like this: (I have a file under idrac-ansible-module-master/hosts/ the file name is myhosts and it look like this: [myhosts]

    hostname iDRAC IP/NAME

    localadmin idracip=10.0.0.41

    1. ansible-playbook get_cpu_inventory.yml doesn't work, see below error: the full traceback, use -vvv. The error was: requests.exceptions.SSLError: HTTPSConnectionPool(host='10.0.0.41', port=443): Max retries exceeded with url: /redfish/v1/Systems/System.Embedded.1/Processors (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),)) fatal: [localadmin -> localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_KG5vuv/ansible_module_idrac.py\", line 1131, in \n main()\n File \"/tmp/ansible_KG5vuv/ansible_module_idrac.py\", line 1023, in main\n result = get_cpu_inventory(IDRAC_INFO, root_uri, rf_uri)\n File \"/tmp/ansible_KG5vuv/ansible_module_idrac.py\", line 787, in get_cpu_inventory\n response = send_get_request(IDRAC_INFO, root_uri + rf_uri)\n File \"/tmp/ansible_KG5vuv/ansible_module_idrac.py\", line 153, in send_get_request\n response = requests.get(uri, verify=False, auth=(idrac['user'], idrac['pswd']))\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 72, in get\n return request('get', url, params=params, kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/api.py\", line 58, in request\n return session.request(method=method, url=url, kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 508, in request\n resp = self.send(prep, send_kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/sessions.py\", line 618, in send\n r = adapter.send(request, kwargs)\n File \"/usr/local/lib/python2.7/dist-packages/requests/adapters.py\", line 506, in send\n raise SSLError(e, request=request)\nrequests.exceptions.SSLError: HTTPSConnectionPool(host='10.0.0.41', port=443): Max retries exceeded with url: /redfish/v1/Systems/System.Embedded.1/Processors (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),))\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0} ...ignoring
prabhakarpujeri commented 6 years ago

looks like you need to add host_key_checking = False in you ansible configuration

aviv12825 commented 6 years ago

sorry for the "stupid" question - but where extacly (location) I need to add host_key_checking = False?

prabhakarpujeri commented 6 years ago

for Linux it stored in /etc/ansible/ansible.cfg but i am not sure about windows

harleylrn commented 6 years ago

You can put ansible.cfg in the directory of the playbook and run the playbooks directly from there.

jose-delarosa commented 6 years ago

Copied from http://bit.ly/2DL35g3:

You can do it either in the /etc/ansible/ansible.cfg or ~/.ansible.cfg file:

[defaults] host_key_checking = False Or you can pass it from the command line:

ansible-playbook -e 'host_key_checking=False' yourplaybook.yml Or you can setup and env variable (this might not work on newer ansible versions):

export ANSIBLE_HOST_KEY_CHECKING=False

jose-delarosa commented 6 years ago

There seem to be more than one issue reported here, will address here but if you find other problems please open a separate bug.

  1. The Deprecation Warnings will be handled shortly. Nothing is affected by these warnings.
  2. Looks like the playbooks were able to find the module after all? Install script coming soon so hopefully this won't be a problem.
  3. The SSL warnings/errors are caused by the requests library I believe, I've seen them before but are intermittent. On the next run, I don't see them. Are they happening consistently for you? I will take a look as time allows. Did disabling ssh host key checking solve this?
jose-delarosa commented 6 years ago

Closing, if you have any questions please open another issue.