Need to verify tomcat's version on the server while running ansible playbooks. The only way I know to do that is:
[root@server ~]# cd /usr/share/tomcat8/bin/
[root@server bin]# ./version.sh
Using CATALINA_BASE: /usr/share/tomcat8
Using CATALINA_HOME: /usr/share/tomcat8
Using CATALINA_TMPDIR: /usr/share/tomcat8/temp
Using JRE_HOME: /usr
Using CLASSPATH: /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
Server version: Apache Tomcat/8.0.30
Server built: Dec 1 2015 22:30:46 UTC
Server number: 8.0.30.0
OS Name: Linux
OS Version: 2.6.32-504.1.3.el6.x86_64
Architecture: amd64
JVM Version: 1.8.0_66-b17
JVM Vendor: Oracle Corporation
Is there any other way? This one isn't the nicest one since even the directory of this version.sh script changes depending on tomcat version and there is a lot of parsing to do.