Do you have 'localhost' defined in your inventory? If so, have you specified ansible_python_interpreter=/usr/local/bin/python along with it in your inventory?
You do mention that /usr/bin/python has access to httplib2, but that could be due to something such as setting PYTHONPATH somewhere that would allow /usr/bin/python to load httplib2 that it wouldn't otherwise have access to, and as a result ansible is running without access to PYTHONPATH maybe... The code that determines if you have httplib2 is somewhat simple: HAS_HTTPLIB2 = True try: import httplib2 except ImportError: HAS_HTTPLIB2 = False And later if HAS_HTTPLIB2 is False, it fails with the message you are seeing. Perhaps try running: /usr/bin/python -c "import httplib2; print httplib2.__file__" /usr/local/bin/python -c "import httplib2; print httplib2.__file__" As well as looking at: echo $PYTHONPATH -- Matt Martz [email protected] On April 22, 2014 at 4:43:37 PM, Kesten Broughton ([email protected]) wrote: Running the task - name: Get tenant id uri: url="{{ os_service_endpoint }}/tenants?name={{tenant.name}}" method=GET timeout=30 return_content=yes HEADER_User-Agent=python-keystoneclient HEADER_X-Auth-Token="{{keystone_admin_token}}" HEADER_Content-Type="application/json" register: register_tenant TASK: [Get tenant id] ********************************************************* <localhost> REMOTE_MODULE uri url="http://example.com:35357/v2.0//tenants?name=tenant2" method=GET timeout=30 return_content=yes HEADER_User-Agent=python-keystoneclient HEADER_X-Auth-Token="*****" HEADER_Content-Type="application/json" <localhost> EXEC ['/bin/sh', '-c', 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1398201502.91-131706600599036 && echo $HOME/.ansible/tmp/ansible-tmp-1398201502.91-131706600599036'] <localhost> PUT /var/folders/t2/h22337c12hn279xwd4s9fk7s8_088c/T/tmpLEIdmk TO /Users/kbroughton/.ansible/tmp/ansible-tmp-1398201502.91-131706600599036/uri <localhost> EXEC /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=turelpokuakqdltyqvhjhfyyvmrqaail] password: " -u root /bin/sh -c '"'"'echo SUDO-SUCCESS-turelpokuakqdltyqvhjhfyyvmrqaail; /usr/bin/python /Users/kbroughton/.ansible/tmp/ansible-tmp-1398201502.91-131706600599036/uri; rm -rf /Users/kbroughton/.ansible/tmp/ansible-tmp-1398201502.91-131706600599036/ >/dev/null 2>&1'"'"'' failed: [localhost] => {"failed": true, "item": ""} msg: httplib2 is not installed FATAL: all hosts have already failed -- aborting ----------------- Running ansible 1.6 on a mac Default python is 2.7.6 in /usr/local/bin/python . That one can import httplib2. [kbroughton@mb-kbroughton:lynx-ansible/21ct-ansible + (develop)] which python /usr/local/bin/python ansible seems to use /usr/bin/python, but that also can import httplib2 [kbroughton@mb-kbroughton:/21ct-ansible + (develop)] /usr/bin/python Python 2.7.5 (default, Aug 25 2013, 00:04:04) [GCC 4.2.1 Compatible Apple LLVM 5.0 (clang-500.0.68)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import httplib2 >>> The play is run against localhost (my mac) but even the 3 controller openstack nodes have httplib2 installed (though in dist-packages not site-packages because it is ubuntu). any ideas? -- Kesten Broughton 512 701 4209 -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAO2fFsXRGrp20pH09FK_ez6FChYsMOFEjDoLhA3HQjmt-zPAJg%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/etPan.5356e63b.643c9869.5a2f%40mobiletuvix.rackspace.corp. For more options, visit https://groups.google.com/d/optout.
