Search code examples
puppet

Install Apache TomCat using Puppet


Has anyone successfully installed Apache Tomcat using Puppet? I am following the instructions on Puppets own tomcat module - https://forge.puppetlabs.com/puppetlabs/tomcat but it does not work!


Solution

  • I have managed to get this working - I believe firewalls was the issue.

    node 'xx' {
    
      include os
    
      class { 'tomcat': }
      class { 'java': }
      tomcat::instance { 'test':
        source_url => 'http://mirror.nexcess.net/apache/tomcat/tomcat-7/v7.0.57/bin/apache-tomcat-7.0.57.tar.gz'
      }->tomcat::service { 'default': }
    
      Class['os'] -> Class['tomcat']
    
     }  
    
    
     class os {
    
    
      exec { "chkconfig_iptables":
              onlyif => "/sbin/chkconfig --level 3 iptables",
              command => "/sbin/chkconfig --level 3 iptables off",
              before => exec["kill_iptables"]
         }
      exec { "kill_iptables":
              onlyif => "/sbin/lsmod | grep ip_tables",
              command => "/sbin/service iptables stop;/sbin/modprobe -f -r ip_tables"
          }
    
    
     }