fuel-library/deployment/puppet/nailgun/manifests/nginx_service.pp
Maksim Malchuk 8b87f79550 Puppet4 propper support in the nailgun module
* Adapt to Puppet 4
* Code cleanup

Change-Id: I60f7d0d7237303d610c90e002c4e5c22fedecf27
Closes-Bug: #1533352
2016-01-14 18:13:00 +03:00

29 lines
720 B
Puppet

class nailgun::nginx_service (
$service_enabled = true,
) {
if ( $service_enabled == false ){
$ensure = false
} else {
$ensure = 'running'
}
file { '/etc/nginx/nginx.conf':
ensure => present,
content => template('nailgun/nginx.conf.erb'),
owner => 'root',
group => 'root',
mode => '0644',
require => Package['nginx'],
notify => Service['nginx'],
}
service { 'nginx':
ensure => $ensure,
enable => $service_enabled,
require => File['/etc/nginx/nginx.conf'],
}
Package<| title == 'nginx'|> ~> Service<| title == 'nginx'|>
if !defined(Service['nginx']) {
notify{ "Module ${module_name} cannot notify service nginx package update": }
}
}