Ask Your Question
1

Installing Solr using tomcat7 puppet module

asked 2014-05-01 20:38:45 -0500

kamal2222ahmed gravatar image

I have managed to develop a tomcat 7 puppet module working on Centos 6.4, and now would like to install Solr on the same tomcat instance. Could not find any example that addresses this, or maybe its obscured by my lack of knowledge of puppet:

here is what i thought can work ( correct me if i am wrong ) in the tomcat manifests, i have solr.pp

modules/tomcat/manifests $ more solr.pp

class solr {

  file { '/usr/share/apache-tomcat-7.0.42/webapps/solr.war':
    ensure => present,
    owner   => root,
    group   => root,  
    mode    => 644,   
    source => 'puppet:///modules/solr/apache-solr-3.6.1.war',
    notify => Service['tomcat'],
  }

  file { '/usr/share/apache-tomcat-7.0.42/solr':
    ensure => present,
    source => 'puppet:///modules/solr/solr',
    recurse => true,
    require => File[''/usr/share/apache-tomcat-7.0.42/webapps/solr.war'],
    notify => Service['tomcat'],
  }

  $solr_dirs = [ "'/usr/share/apache-tomcat-7.0.42/webapps/solr/", "'/usr/share/apache-tomcat-7.0.42/webapps/solr/WEB-INF/", 
                  '/usr/share/apache-tomcat-7.0.42/webapps/solr/WEB-INF/lib/"]
  file { $solr_dirs:
      ensure => "directory",
  }

  file { ''/usr/share/apache-tomcat-7.0.42/webapps/solr/WEB-INF/web.xml':
    ensure => present,
    owner   => root,
    group   => root,  
    mode    => 644,   
    source => 'puppet:///modules/solr/web.xml',
    require => File[$solr_dirs],
  }

  file { '/usr/share/apache-tomcat-7.0.42/webapps/solr/WEB-INF/lib/apache-solr-dataimporthandler-3.6.1.jar':
    ensure => present,
    owner   => root,
    group   => root,  
    mode    => 644,   
    source => 'puppet:///modules/solr/apache-solr-dataimporthandler-3.6.1.jar',
    require => File[$solr_dirs],
  }


}

Now, how would i call this class ? like tomcat::solr ? as include tomcat::solr or name the class tomcat::solr plus would this sort of methodology work ? i also would like to have the solr war, etc under ../files/

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2014-05-02 04:34:20 -0500

ffrank gravatar image

IMO, you'd want tomcat and solr to be independent modules, although solr will include tomcat in most cases.

I'm not sure what you mean be ../files. The solr specific files do belong into the solr module. Your URLs already suggest as much: puppet:///modules/solr/apache-solr-dataimporthandler-3.6.1.jar will be looked up in $modulepath/solr/files/apache-solr-dataimporthandler-3.6.1.jar. This design is structurally sound.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2014-05-01 20:38:45 -0500

Seen: 338 times

Last updated: May 02 '14