Sha256: 6926698f4e6e01358b563a32cf97a6ce34d9a1615911b7ec6f3172f679d06cb0

Contents?: true

Size: 1.36 KB

Versions: 20

Compression:

Stored size: 1.36 KB

Contents

# Class: nginx::service
#
# This module manages NGINX service management and vhost rebuild
#
# Parameters:
#
# There are no default parameters for this class.
#
# Actions:
#
# Requires:
#
# Sample Usage:
#
# This class file is not called directly
class nginx::service(
  $configtest_enable = $nginx::params::nx_configtest_enable,
  $service_restart   = $nginx::params::nx_service_restart
) {
  exec { 'rebuild-nginx-vhosts':
    command     => "/bin/cat ${nginx::params::nx_temp_dir}/nginx.d/* > ${nginx::params::nx_conf_dir}/conf.d/vhost_autogen.conf",
    refreshonly => true,
    unless      => "/usr/bin/test ! -f ${nginx::params::nx_temp_dir}/nginx.d/*",
    subscribe   => File["${nginx::params::nx_temp_dir}/nginx.d"],
  }
  exec { 'rebuild-nginx-mailhosts':
    command     => "/bin/cat ${nginx::params::nx_temp_dir}/nginx.mail.d/* > ${nginx::params::nx_conf_dir}/conf.mail.d/vhost_autogen.conf",
    refreshonly => true,
    unless      => "/usr/bin/test ! -f ${nginx::params::nx_temp_dir}/nginx.mail.d/*",
    subscribe   => File["${nginx::params::nx_temp_dir}/nginx.mail.d"],
  }
  service { 'nginx':
    ensure     => running,
    enable     => true,
    hasstatus  => true,
    hasrestart => true,
    subscribe  => Exec['rebuild-nginx-vhosts', 'rebuild-nginx-mailhosts'],
  }
  if $configtest_enable == true {
    Service['nginx'] {
      restart => $service_restart,
    }
  }
}

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
freighthop-0.6.1 modules/nginx/manifests/service.pp
freighthop-0.6.0 modules/nginx/manifests/service.pp
freighthop-0.5.2 modules/nginx/manifests/service.pp
freighthop-0.5.1 modules/nginx/manifests/service.pp
freighthop-0.5.0 modules/nginx/manifests/service.pp
freighthop-0.4.1 modules/nginx/manifests/service.pp
freighthop-0.4.0 modules/nginx/manifests/service.pp
freighthop-0.3.3 modules/nginx/manifests/service.pp
freighthop-0.3.2 modules/nginx/manifests/service.pp
freighthop-0.3.1 modules/nginx/manifests/service.pp
freighthop-0.3.0 modules/nginx/manifests/service.pp
freighthop-0.2.1 modules/nginx/manifests/service.pp
freighthop-0.2.0 modules/nginx/manifests/service.pp
freighthop-0.1.0 modules/nginx/manifests/service.pp
freighthop-0.0.6 modules/nginx/manifests/service.pp
freighthop-0.0.5 modules/nginx/manifests/service.pp
freighthop-0.0.4 modules/nginx/manifests/service.pp
freighthop-0.0.3 modules/nginx/manifests/service.pp
freighthop-0.0.2 modules/nginx/manifests/service.pp
freighthop-0.0.1 modules/nginx/manifests/service.pp