Follow

How to Fix Ansible Error During Installation

If you are seeing the following error, then the following steps will fix this error and allow you to complete your installation:

TASK [Download dep files] ******************************************************
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: AttributeError: 'function' object has no attribute 'urlsplit'
failed: [localhost] (item=agent.tar.bz2) => {"failed": true, "item": "agent.tar.bz2", "module_stderr": "Traceback (most recent call last):\n File \"/tmp/ansible_mwHDJB/ansible_module_get_url.py\", line 437, in <module>\n main()\n File \"/tmp/ansible_mwHDJB/ansible_module_get_url.py\", line 358, in main\n filename = url_filename(info['url'])\n File \"/tmp/ansible_mwHDJB/ansible_module_get_url.py\", line 192, in url_filename\n fn = os.path.basename(urlparse.urlsplit(url)[2])\nAttributeError: 'function' object has no attribute 'urlsplit'\n", "module_stdout": "", "msg": "MODULE FAILURE", "rc": 0}
to retry, use: --limit @/tmp/pre_playbook.retry
  1.  Edit the following file: 

    /usr/lib/python2.7/site-packages/ansible/modules/core/network/basics/get_url.py

  2. Find the
    import urlparse
    line and add the following line underneath it:
    from ansible.module_utils.six.moves.urllib.parse import urlsplit
  3. Replace the line 
    fn = os.path.basename(urlparse.urlsplit(url)[2])
    with the following:
    fn = os.path.basename(urlsplit(url)[2])
  4. Save the changes and rerun the installation script.
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.