This repository has been archived by the owner. It is now read-only.

digital_ocean module: got msg: dopy >= 0.2.3 required for this module all time #360

Closed
puliaiev opened this Issue Nov 19, 2014 · 14 comments

Comments

Projects
None yet
@puliaiev
Copy link

puliaiev commented Nov 19, 2014

Issue Type:

Bug Report

Ansible Version:

ansible 1.7.2

Environment:

OS X Yosemite
Version: 10.10.1

Summary:

All time got error:
msg: dopy >= 0.2.3 required for this module all time

pip list
ansible (1.7.2)
dopy (0.3.0)

Steps To Reproduce:

  • hosts: local
    connection: local
    tasks:
    • digital_ocean: >
      state=present
      command=ssh
      name=digitalocean_rsa
      ssh_pub_key='ssh-rsa AAAAB3NzaC1yc'
      client_id={{client_id}}
      api_key={{api_key}}
Expected Results:

Expected Ok result

Actual Results:

failed: [localhost] => {"failed": true}
msg: dopy >= 0.2.3 required for this module

FATAL: all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
to retry, use: --limit @/Users/sevaua/do.yaml.retry

localhost : ok=1 changed=0 unreachable=0 failed=1

@bcoca

This comment has been minimized.

Copy link
Member

bcoca commented Nov 19, 2014

Possible Misunderstanding

Hi!

Thanks very much for your submission to Ansible. It sincerely means a lot to us.

We believe the ticket you have filed is being somewhat misunderstood, as one thing works a little differently than stated.

The digital ocean modules have extra an requirement, the 'dopy' library of at least version 0.2.3, as the
error message states. You need to install that on your 'master' to use the modules.

In the future, this might be a topic more well suited for the user list, which you can also post here if you'd like some more help with the above.

Thank you once again for this and your interest in Ansible!

@bcoca bcoca closed this Nov 19, 2014

@pmackay

This comment has been minimized.

Copy link

pmackay commented Jan 3, 2015

Why was this closed @bcoca? The report says that pip list shows dopy is present, but the module still reports it needs the library. I'm finding a similar situation. How to resolve?

@puliaiev

This comment has been minimized.

Copy link

puliaiev commented Jan 3, 2015

I have added next line in hosts file:

localhost ansible_connection=local ansible_python_interpreter=python

https://groups.google.com/forum/?hl=ru#!topic/ansible-project/gjQM-rArtTg

@sjelfull

This comment has been minimized.

Copy link

sjelfull commented Mar 27, 2015

That was helpful, @SevaUA.

@Paxa

This comment has been minimized.

Copy link

Paxa commented Nov 21, 2015

Got same error with ansible 1.9.4

solved by installing exact version:

sudo pip install 'dopy>=0.2.3,<=0.2.3'

The original error message is (without try-except):

>>> import dopy
>>> from dopy.manager import DoError, DoManager
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Python/2.7/site-packages/dopy/manager.py", line 10, in <module>
    from six import wraps
ImportError: cannot import name wraps
@lcacciagioni

This comment has been minimized.

Copy link

lcacciagioni commented Dec 5, 2015

It didn't solve the issue for me, this is still valid please reopen this issue.

@abadger

This comment has been minimized.

Copy link
Member

abadger commented Dec 6, 2015

@lcacciagioni

This comment has been minimized.

Copy link

lcacciagioni commented Dec 6, 2015

Fixed it seems to be that it needs six installed but this is not included explicitly in the dependencies, after installing it it works perfectly.

@Freika

This comment has been minimized.

Copy link

Freika commented Jan 10, 2017

Same issue here:

fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "dopy >= 0.3.2 required for this module"}

Installing exact version didn't help (I guess, it's because there is no 0.3.2 version, only 0.3.3)

@bmmseven

This comment has been minimized.

Copy link

bmmseven commented Feb 14, 2017

I had a similar problem using my Macbook. The problem seemed to have origin within the "setuptools" python module that came pre-installed with my Mac. The solution for me was to upgrade that module to the last version, by running in the following in the command line: pip install --upgrade setuptools --user python
I hope this can be useful to someone.

@Freika

This comment has been minimized.

Copy link

Freika commented Feb 15, 2017

I solved my problem by removing brew version of ansible and installing pip version.

@potterhe

This comment has been minimized.

Copy link

potterhe commented Mar 13, 2017

I solved by "/usr/local/Cellar/ansible/2.2.1.0_1/libexec/bin/pip install dopy"

@mjmare

This comment has been minimized.

Copy link

mjmare commented Mar 22, 2017

Uninstalling the brew installed ansible did not love this problem. Only after adding "ansible_python_interpreter=python" to the hosts.ini things worked.

mylocalhost ansible_connection=local ansible_python_interpreter=python

ansible and dopy (0.3.7) are installed into a virtualenv. Ansible-playbook is run from the virtualenv:

venv/bin/ansible-playbook
@jdickey

This comment has been minimized.

Copy link

jdickey commented Aug 4, 2017

Running into the same problems as well:

$ uname -v
Darwin Kernel Version 15.6.0: Sun Jun  4 21:43:07 PDT 2017; root:xnu-3248.70.3~1/RELEASE_X86_64
$ ansible --version
ansible 2.3.1.0
  config file = 
  configured module search path = Default w/o overrides
  python version = 2.7.13 (default, Jul 18 2017, 09:16:53) [GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)]
$ python --version
Python 2.7.10
$ /usr/local/Cellar/ansible/2.3.1.0/libexec/bin/python --version
Python 2.7.13
$
$
$
$ ansible-playbook digitalocean.yml                     

PLAY [digitalocean] ****************************************************************************************************************************************************************************************************************************

TASK [Gathering Facts] *************************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [ensure ssh key exists] *******************************************************************************************************************************************************************************************************************
ok: [localhost]

TASK [ensure key exists at DigitalOcean] *******************************************************************************************************************************************************************************************************
fatal: [localhost]: FAILED! => {"changed": false, "failed": true, "msg": "dopy >= 0.3.2 required for this module"}
	to retry, use: --limit @/Users/jeffdickey/src/script/grid-demo/digitalocean.retry

PLAY RECAP *************************************************************************************************************************************************************************************************************************************
localhost                  : ok=2    changed=0    unreachable=0    failed=1   

$

The playbook (from this DO tutorial) is:

---
- hosts: digitalocean

  vars:
    do_token: fe6736... # elided for a public post

  tasks:

  - name: ensure ssh key exists
    user: >
      name={{ ansible_user_id }}
      generate_ssh_key=yes
      ssh_key_file=.ssh/id_rsa

  - name: ensure key exists at DigitalOcean
    digital_ocean: >
      state=present
      command=ssh
      name=my_ssh_key
      ssh_pub_key={{ lookup('file', '~/.ssh/id_rsa.pub') }}
      api_token={{ do_token }}
    register: my_ssh_key

  - name: ensure droplet one exists
    digital_ocean: >
      state=present
      command=droplet
      name=droplet-one
      size_id=512mb
      region_id=sgp1
      image_id=ubuntu-16-04-x64
      ssh_key_ids={{ my_ssh_key.ssh_key.id }}
      api_token={{ do_token }}
    register: droplet_one

  - debug: msg="IP is {{ droplet_one.droplet.ip_address }}"

Just to be utterly pedantic, I do not have an existing Droplet by the name of droplet-one:

$ doclt droplets list --no-color
┌──────────┬───────────────┬─────────────────┬────────┐
│ ID       │ Name          │ IPv4            │ Status │
├──────────┼───────────────┼─────────────────┼────────┤
│ xxxxxxxx │ suirdemo1-off │ 10.130.10.xxx   │ off    │
│          │               │ 128.199.105.xxx │        │
├──────────┼───────────────┼─────────────────┼────────┤
│ xxxxxxxx │ suirdemo2     │ 10.130.19.xxx   │ active │
│          │               │ 128.199.73.xxx  │        │
├──────────┼───────────────┼─────────────────┼────────┤
│ xxxxxxxx │ demo2         │ 10.130.39.xxx   │ active │
│          │               │ 139.59.115.xxx  │        │
├──────────┼───────────────┼─────────────────┼────────┤
│ xxxxxxxx │ demo1-off     │ 10.130.34.xx    │ off    │
│          │               │ 128.199.239.xxx │        │
└──────────┴───────────────┴─────────────────┴────────┘
$

Any ideas for how to proceed would be greatly appreciated.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.