dev/provisioning/modules/sysconfig/manifests/tomcat.pp
author ymh <ymh.work@gmail.com>
Tue, 07 Jun 2016 01:16:31 +0200
changeset 173 cf7b221238fd
parent 28 b0b56e0f8c7f
permissions -rw-r--r--
Work on test fixtures: - get rid both on bo and front of 2 fixtures files for documents - correct dl_fixtures to reflect this - upgrade mirage from 0.1.13 to 0.2.0 - download new version of documents fixtures including geo information

class sysconfig::tomcat (
    $tomcat_open_port = hiera('sysconfig::params::tomcat_open_port', sysconfig::params::tomcat_open_port),
) inherits sysconfig::params {

    $package_list = [
        'tomcat'
    ]

    package { $package_list:
        ensure => present,
        require => Package['java-1.8.0-openjdk-headless']
    }

    if any2bool($tomcat_open_port) {
        exec { "open-tomcat-port":
            command => "firewall-cmd --permanent --add-port=8080/tcp",
            path => [ '/bin', '/usr/bin', '/usr/local/bin' ]
        }->
        exec { "open-tomcat-port-reload":
            command => "firewall-cmd --reload",
            path => [ '/bin', '/usr/bin', '/usr/local/bin' ]
        }
    }

    service { "tomcat":
        ensure => running,
        enable => true,
        require => Package['tomcat']
    }

}