uri module fails while httplib2 is installed

Hi,

I am trying to download some resource from the web using the uri module as follows

  • name: Download the resource from the web
    uri: url={{app_url}} dest=/opt/app creates=/opt/app/{{app_version}}

This keeps failing with the following error:

failed: [192.168.111.222] => {“failed”: true, “item”: “”}
msg: httplib2 is not installed

httplib2 is installed however:

lars (master)$ pip install httplib2
Requirement already satisfied (use --upgrade to upgrade): httplib2 in /usr/local/lib/python2.7/site-packages
Cleaning up…

Any idea what can be the cause?

Thanks, Lars

Never mind… the task is run on the server and not on my laptop… doh!

Lars

I just spent half an hour trying to work out why this was failing too.
It’d be good if the uri module made it clearer about where the fetch was run from, I think.

Yeah, this is not something Ansible’s going to do, because it’s an intrinsitic language feature:

  • hosts: webservers
    tasks:

Will ALWAYS run on those servers, and that’s true of all the base modules.

Unless you have a step in the middle that says local_action, etc, it’s going to run where you tell it :slight_smile: