Search code examples
tomcatchef-infravagrantcookbook

Installing tomcat7 with Tomcat Cookbook


Using vagrant-berkshelf on my CentOS 6.5 box, I tried to specify 7 as the version of Tomcat to install:

    "tomcat" => {
      "base_version" => "7"
    }

However, when I tried to run vagrant provision, I ran into an error:

[2014-03-21T18:23:50+00:00] ERROR: package[tomcat7] (tomcat::default line 45) 
       had an error: Chef::Exceptions::Package: No version specified, 
       and no candidate version available for tomcat7

This Opscode "Add Support for Tomcat7" bug is marked as "Fixed", but it's only shown as tested for Ubuntu 12.04. I'm not sure if that means that (a) it wasn't tested for CentOS or (b) it was never broken for CentOS.

How can I use tomcat7 on my vagrant box with Chef?


Solution

  • It seems that tomcat7 is not in the standard/epel repositories for centos6.5 yet.

    [root@secure36 rfridman]# cat /etc/issue
    CentOS release 6.5 (Final)
    
    [root@secure36 rfridman]# yum search tomcat
    Loaded plugins: fastestmirror, security
    Loading mirror speeds from cached hostfile
     * base: mirror.atlanticmetro.net
     * epel: mirror.symnds.com
     * extras: mirror.es.its.nyu.edu
     * updates: mirror.cogentco.com
    ==================================================================== N/S Matched: tomcat =====================================================================
    tomcatjss.noarch : JSSE implementation using JSS for Tomcat
    apache-tomcat-apis.noarch : Tomcat Servlet and JSP APIs
    jakarta-commons-collections-tomcat5.noarch : Jakarta Commons Collection dependency for Tomcat5
    jakarta-commons-dbcp-tomcat5.noarch : DBCP dependency for Tomcat5
    jakarta-commons-pool-tomcat5.x86_64 : Pool dependency for Tomcat5
    jglobus-ssl-proxies-tomcat.noarch : Globus Java - SSL and proxy certificate support for Tomcat
    tomcat-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
    tomcat-docs-webapp.noarch : The docs web application for Apache Tomcat
    tomcat-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
    tomcat-jsp-2.2-api.noarch : Apache Tomcat JSP API implementation classes
    tomcat-jsvc.noarch : Apache jsvc wrapper for Apache Tomcat as separate service
    tomcat-lib.noarch : Libraries needed to run the Tomcat Web container
    tomcat-native.x86_64 : Tomcat native library
    tomcat-servlet-3.0-api.noarch : Apache Tomcat Servlet API implementation classes
    tomcat-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
    tomcat6.noarch : Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
    tomcat6-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
    tomcat6-docs-webapp.noarch : The docs web application for Apache Tomcat
    tomcat6-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
    tomcat6-jsp-2.1-api.noarch : Apache Tomcat JSP API implementation classes
    tomcat6-lib.noarch : Libraries needed to run the Tomcat Web container
    tomcat6-servlet-2.5-api.noarch : Apache Tomcat Servlet API implementation classes
    tomcat6-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
    glite-security-trustmanager-tomcat6.noarch : Java trustmanager interface supporting a GSI grid name space
    tomcat.noarch : Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
    tomcat-el-2.2-api.noarch : Expression Language v1.0 API
    tomcat6-el-2.1-api.noarch : Expression Language v1.0 API
    

    You should try to compile the tomcat7 from the source, or try to find the repository with tomcat7 included and add it to your cookbooks configuration.