From 4bcb0993c180b94c7d9a3f122b14068a2420f31b Mon Sep 17 00:00:00 2001 From: Sander Hoentjen Date: Wed, 8 May 2013 14:15:42 +0200 Subject: [PATCH] linting --- manifests/config.pp | 8 ++++---- manifests/package.pp | 5 ++++- manifests/package/redhat.pp | 6 +++--- manifests/params.pp | 4 ++-- manifests/resource/location.pp | 7 ++++--- manifests/resource/mailhost.pp | 2 +- manifests/service.pp | 4 ++-- tests/vhost.pp | 6 +++--- 8 files changed, 23 insertions(+), 19 deletions(-) diff --git a/manifests/config.pp b/manifests/config.pp index 958799de9..96b0a1d2d 100644 --- a/manifests/config.pp +++ b/manifests/config.pp @@ -36,8 +36,8 @@ } if $confd_purge == true { File["${nginx::params::nx_conf_dir}/conf.d"] { - ignore => "vhost_autogen.conf", - purge => true, + ignore => 'vhost_autogen.conf', + purge => true, recurse => true, } } @@ -47,8 +47,8 @@ } if $confd_purge == true { File["${nginx::params::nx_conf_dir}/conf.mail.d"] { - ignore => "vhost_autogen.conf", - purge => true, + ignore => 'vhost_autogen.conf', + purge => true, recurse => true, } } diff --git a/manifests/package.pp b/manifests/package.pp index 9eb888f3e..be543c055 100644 --- a/manifests/package.pp +++ b/manifests/package.pp @@ -31,7 +31,7 @@ } } debian,ubuntu: { - class { 'nginx::package::debian': + class { 'nginx::package::debian': require => Anchor['nginx::package::begin'], before => Anchor['nginx::package::end'], } @@ -42,5 +42,8 @@ before => Anchor['nginx::package::end'], } } + default: { + fail("Module ${module_name} is not supported on ${::operatingsystem}") + } } } diff --git a/manifests/package/redhat.pp b/manifests/package/redhat.pp index f44df2d58..0c095a7d0 100644 --- a/manifests/package/redhat.pp +++ b/manifests/package/redhat.pp @@ -16,8 +16,8 @@ class nginx::package::redhat { $redhat_packages = ['nginx', 'GeoIP', 'gd', 'libXpm', 'libxslt'] - if downcase($::operatingsystem) == "redhat" { - $os_type = "rhel" + if downcase($::operatingsystem) == 'redhat' { + $os_type = 'rhel' } else { $os_type = downcase($::operatingsystem) } @@ -28,7 +28,7 @@ $os_rel = $::lsbmajdistrelease } - yumrepo { "nginx-release": + yumrepo { 'nginx-release': baseurl => "http://nginx.org/packages/${os_type}/${os_rel}/\$basearch/", descr => 'nginx repo', enabled => '1', diff --git a/manifests/params.pp b/manifests/params.pp index d1b62386e..53f81797d 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -64,8 +64,8 @@ # Service restart after Nginx 0.7.53 could also be just "/path/to/nginx/bin -s HUP" # Some init scripts do a configtest, some don't. If configtest_enable it's true # then service restart will take $nx_service_restart value, forcing configtest. - $nx_configtest_enable = false - $nx_service_restart = "/etc/init.d/nginx configtest && /etc/init.d/nginx restart" + $nx_configtest_enable = false + $nx_service_restart = '/etc/init.d/nginx configtest && /etc/init.d/nginx restart' $nx_mail = false diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index b90cc018b..4453ea0d9 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -12,7 +12,7 @@ # with nginx::resource::upstream # [*proxy_read_timeout*] - Override the default the proxy read timeout value of 90 seconds # [*ssl*] - Indicates whether to setup SSL bindings for this location. -# [*ssl_only*] - Required if the SSL and normal vHost have the same port. +# [*ssl_only*] - Required if the SSL and normal vHost have the same port. # [*location_alias*] - Path to be used as basis for serving requests for this location # [*stub_status*] - If true it will point configure module stub_status to provide nginx stats on location # [*location_cfg_prepend*] - It expects a hash with custom directives to put before anything else inside location @@ -48,6 +48,7 @@ # } define nginx::resource::location ( + $location, $ensure = present, $vhost = undef, $www_root = undef, @@ -64,8 +65,8 @@ $stub_status = undef, $location_cfg_prepend = undef, $location_cfg_append = undef, - $try_files = undef, - $location) { + $try_files = undef +) { File { owner => 'root', group => 'root', diff --git a/manifests/resource/mailhost.pp b/manifests/resource/mailhost.pp index 950ecd1aa..d82480d4f 100644 --- a/manifests/resource/mailhost.pp +++ b/manifests/resource/mailhost.pp @@ -42,9 +42,9 @@ # ssl_key => '/tmp/server.pem', # } define nginx::resource::mailhost ( + $listen_port, $ensure = 'enable', $listen_ip = '*', - $listen_port, $listen_options = undef, $ipv6_enable = false, $ipv6_listen_ip = '::', diff --git a/manifests/service.pp b/manifests/service.pp index 2de19a628..8441f3e4d 100644 --- a/manifests/service.pp +++ b/manifests/service.pp @@ -29,7 +29,7 @@ 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": + service { 'nginx': ensure => running, enable => true, hasstatus => true, @@ -37,7 +37,7 @@ subscribe => Exec['rebuild-nginx-vhosts', 'rebuild-nginx-mailhosts'], } if $configtest_enable == true { - Service["nginx"] { + Service['nginx'] { restart => $service_restart, } } diff --git a/tests/vhost.pp b/tests/vhost.pp index 78b050bfd..da5a7b83a 100644 --- a/tests/vhost.pp +++ b/tests/vhost.pp @@ -2,15 +2,15 @@ nginx::resource::vhost { 'test.local': ensure => present, - ipv6_enable => 'true', + ipv6_enable => true, proxy => 'http://proxypass', } nginx::resource::vhost { 'test.local:8080': + ensure => present, listen_port => 8080, server_name => 'test.local', - ensure => present, - ipv6_enable => 'true', + ipv6_enable => true, proxy => 'http://proxypass', }