So far I've been using the following recipe for installing Solr 3.x on Tomcat 6:
package { 'openjdk-6-jdk' :
ensure => installed,
}
package { 'solr-tomcat' :
ensure => installed,
}
exec { 'tomcat-port':
command => "sed -i.bak 's|port=\"8080\"|port=\"8983\"|g' /etc/tomcat6/server.xml",
path => ["/bin", "/usr/bin"],
}
service { 'tomcat6' :
ensure => running,
require => Package['solr-tomcat'],
}
However I'd like to install Solr 4.x on Tomcat 7, but it seems Debian doesn't have appropriate packages for Solr (such as solr-tomcat
).
I've so far Tomcat 7 working by:
package { [ 'tomcat7', 'tomcat7-admin' ]: ensure => installed, }
service { 'tomcat7' : ensure => running, }
exec { 'tomcat-port':
command => "sed -i.bak 's|port=\"8080\"|port=\"8983\"|g' /etc/tomcat7/server.xml",
path => ["/bin", "/usr/bin"],
}
But how do I install Solr 4.x?
You can create your own Debian package and host it in your own repository. Projects like FPM (https://github.com/jordansissel/fpm) help a lot here. Another option is to retrieve the Solr tarball from the project website and manage a series of
exec
statements to extract it into the webapps directory in your Tomcat install.The simplest way is to define
exec
, for example:For more flexible solution, you've to write a class (solr4-tomcat.pp), for example:
Checkout the alternative manifests: