dev/provisioning/modules/sysconfig/manifests/tomcat.pp
changeset 28 b0b56e0f8c7f
equal deleted inserted replaced
27:a2342f26c9de 28:b0b56e0f8c7f
       
     1 class sysconfig::tomcat (
       
     2     $tomcat_open_port = hiera('sysconfig::params::tomcat_open_port', sysconfig::params::tomcat_open_port),
       
     3 ) inherits sysconfig::params {
       
     4 
       
     5     $package_list = [
       
     6         'tomcat'
       
     7     ]
       
     8 
       
     9     package { $package_list:
       
    10         ensure => present,
       
    11         require => Package['java-1.8.0-openjdk-headless']
       
    12     }
       
    13 
       
    14     if any2bool($tomcat_open_port) {
       
    15         exec { "open-tomcat-port":
       
    16             command => "firewall-cmd --permanent --add-port=8080/tcp",
       
    17             path => [ '/bin', '/usr/bin', '/usr/local/bin' ]
       
    18         }->
       
    19         exec { "open-tomcat-port-reload":
       
    20             command => "firewall-cmd --reload",
       
    21             path => [ '/bin', '/usr/bin', '/usr/local/bin' ]
       
    22         }
       
    23     }
       
    24 
       
    25     service { "tomcat":
       
    26         ensure => running,
       
    27         enable => true,
       
    28         require => Package['tomcat']
       
    29     }
       
    30 
       
    31 }