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:
OK54UES Server is healthy2.0.5-dDatabaseHealthCheckTaskOK1Database at
jdbc:oracle:thin:@uesdb-ch2-grdb.sys.comcast.net:1521/uesch2a is healthy.
RiakOK52Riak at uesriak-ch2-a-vip.sys.comcast.net: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 jdbc:oracle:thin:@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/7b487ae7-1a59-4c22-978f-0fd1ca099849%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.