I don't see anything wrong with your playbook. The error your getting means that for some reason ansible isn't finding your httplib2 installed on the remote machine(s) (Would be multiple machines if web is a group rather than a single host).
Judging from your description so far, do you have everything installed from one of CentOS or EPEL repositories? On the remote machine, what httplib2 is installed? (For instance, what does this ansible command show: ansible web -m command -a 'rpm -q python-httplib2' -Toshio On Wed, Nov 4, 2015 at 7:55 AM, tom rkba <[email protected]> wrote: > I am trying to figure out what is wrong with either my playbook, python > installation or both. > > Both hosts are running CentOS 6. > Python: python.x86_64 > 2.6.6-52.el6 > Ansible 1.9.4 is installed on the control host. > > The data being returned is: > > OK54Web Server is healthy2.0.5-dDatabaseHealthCheckTaskOK1Database at is > healthy. RiakOK52Riak at riakhost:8087 is healthy. > > I am looking for the string "Web Server is healthy" > > The JSON is: > > <healthcheckresponse> > <code> > OK > </code> > <duration> > 54 > </duration> > <message> > Web Server is healthy > </message> > <version> > 2.0.5-d > </version> > <component_health_check> > <name> > DatabaseHealthCheckTask > </name> > <code> > OK > </code> > <duration> > 1 > </duration> > <message> > Database at @somehost > </message> > </component_health_check> > <component_health_check> > <name> > Riak > </name> > <code> > OK > </code> > <duration> > 52 > </duration> > <message> > Riak at somehost:8087 is … > </message> > </component_health_check> > <link id="lite-css-list"></link> > </healthcheckresponse> > > > I have the following playbook that is intended to connect and pull some data > about what the server is doing: > > ---- > - name: healthCheck > hosts: web > gather_facts: no > serial: 1 > sudo: true > > tasks: > - action: uri url="http://localhost:8080/healthCheck" return_content=yes > register: json_response > > - action: fail > when: TBD (deleted) (I haven't figured this out but it doesn't get > this far anyway; I had some stuff off the Ansible URI page) > ---- > > The result: > > PLAY [healthCheck] ************************************************* > > TASK: [uri url="http://localhost:8080/healthCheck" return_content=yes] **** > failed: [somehost] => {"failed": true} > msg: httplib2 is not installed > > FATAL: all hosts have already failed -- aborting > > PLAY RECAP > ******************************************************************** > to retry, use: --limit @/root/hc.retry > > somehost : ok=0 changed=0 unreachable=0 failed=1 > > > In reviewing the "httplib2 is not installed" message, I followed a bunch of > procedures on the 'net. > > 1) Update rpm to version 1.9.4. > 2) Review python version (see above) > 3) Check for httplib2: > > /usr/lib/python2.6/site-packages > $ ls -dl http* > drwxr-xr-x 2 root root 4096 Jun 3 15:46 httplib2 > drwxr-xr-x 2 root root 4096 Jun 3 15:46 httplib2-0.7.7-py2.6.egg-info > > The lib is present on both hosts. > > > 1) Why is it not finding httplib2 when it's installed in > /usr/lib/python2.6/site-packages? > 2) How do I get Ansible to parse the output looking for "Web Server is > healthy"? > > Thanks! > > -- > 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/77ec454b-3d12-4ee3-b905-157c924957d1%40googlegroups.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/CAG9juEoCDyr-U89u3t%2Bvbd3kvg680fgQqvp5DB91RmgN5MyKcw%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
