From c6a19ad30ce72f000146645b9f82b369e17c9abf Mon Sep 17 00:00:00 2001 From: mh Date: Fri, 27 Feb 2015 09:45:38 +0100 Subject: linting --- manifests/base.pp | 21 ++++---- manifests/centos.pp | 144 ++++++++++++++++++++++++++-------------------------- 2 files changed, 81 insertions(+), 84 deletions(-) diff --git a/manifests/base.pp b/manifests/base.pp index 5b13cac..8029e73 100644 --- a/manifests/base.pp +++ b/manifests/base.pp @@ -55,20 +55,17 @@ class apache::base { owner => root, group => 0, mode => '0644'; - } - anchor{'apache::basic_dirs::ready': - require => File['vhosts_dir','config_dir','include_dir','modules_dir','htpasswd_dir','web_dir','default_apache_index'] - } + } -> anchor{'apache::basic_dirs::ready': } - apache::config::include{ 'defaults.inc': } - apache::config::global{ 'git.conf': } - if !$apache::no_default_site { - apache::vhost::file { '0-default': } - } + apache::config::include{ 'defaults.inc': } + apache::config::global{ 'git.conf': } + if !$apache::no_default_site { + apache::vhost::file { '0-default': } + } service{'apache': - ensure => running, - name => 'apache2', - enable => true, + ensure => running, + name => 'apache2', + enable => true, } } diff --git a/manifests/centos.pp b/manifests/centos.pp index 554e7b2..f469715 100644 --- a/manifests/centos.pp +++ b/manifests/centos.pp @@ -1,86 +1,86 @@ ### centos class apache::centos inherits apache::package { - $config_dir = '/etc/httpd' + $config_dir = '/etc/httpd' - Package[apache]{ - name => 'httpd', - } - Service[apache]{ - name => 'httpd', - restart => '/etc/init.d/httpd graceful', - } - File[vhosts_dir]{ - path => "${config_dir}/vhosts.d", - } - File[config_dir]{ - path => "${config_dir}/conf.d", - } - File[include_dir]{ - path => "${config_dir}/include.d", - } - File[modules_dir]{ - path => "${config_dir}/modules.d", - } - File[web_dir]{ - path => '/var/www/vhosts', - } - File[default_apache_index]{ - path => '/var/www/html/index.html', - } + Package[apache]{ + name => 'httpd', + } + Service[apache]{ + name => 'httpd', + restart => '/etc/init.d/httpd graceful', + } + File[vhosts_dir]{ + path => "${config_dir}/vhosts.d", + } + File[config_dir]{ + path => "${config_dir}/conf.d", + } + File[include_dir]{ + path => "${config_dir}/include.d", + } + File[modules_dir]{ + path => "${config_dir}/modules.d", + } + File[web_dir]{ + path => '/var/www/vhosts', + } + File[default_apache_index]{ + path => '/var/www/html/index.html', + } - if str2bool($::selinux) { - Selinux::Fcontext{ - before => File[web_dir], - } - $seltype_rw = $::operatingsystemmajrelease ? { - 5 => 'httpd_sys_script_rw_t', - default => 'httpd_sys_rw_content_t' - } - selinux::fcontext{ - [ '/var/www/vhosts/[^/]*/www(/.*)?', - '/var/www/vhosts/[^/]*/non_public(/.*)?', - '/var/www/vhosts/[^/]*/data(/.*)?', - '/var/www/vhosts/[^/]*/upload(/.*)?' ]: - require => Package['apache'], - setype => $seltype_rw; - '/var/www/vhosts/[^/]*/logs(/.*)?': - require => Package['apache'], - setype => 'httpd_log_t'; - } + if str2bool($::selinux) { + Selinux::Fcontext{ + before => File[web_dir], } - file{'apache_service_config': - path => '/etc/sysconfig/httpd', - source => [ "puppet:///modules/site_apache/service/CentOS/${::fqdn}/httpd", - 'puppet:///modules/site_apache/service/CentOS/httpd', - 'puppet:///modules/apache/service/CentOS/httpd' ], - require => Package['apache'], - notify => Service['apache'], - owner => root, - group => 0, - mode => '0644'; + $seltype_rw = $::operatingsystemmajrelease ? { + 5 => 'httpd_sys_script_rw_t', + default => 'httpd_sys_rw_content_t' } - - # this is for later fixes - exec{ - 'adjust_pidfile': - command => 'sed -i "s/^#PidFile \(.*\)/PidFile \1/g" /etc/httpd/conf/httpd.conf', - unless => 'grep -qE \'^PidFile \' /etc/httpd/conf/httpd.conf', + selinux::fcontext{ + [ '/var/www/vhosts/[^/]*/www(/.*)?', + '/var/www/vhosts/[^/]*/non_public(/.*)?', + '/var/www/vhosts/[^/]*/data(/.*)?', + '/var/www/vhosts/[^/]*/upload(/.*)?' ]: require => Package['apache'], - notify => Service['apache']; - 'adjust_listen': - command => 'sed -i "s/^#Listen 80/Listen 80/g" /etc/httpd/conf/httpd.conf', - unless => 'grep -qE \'^Listen 80\' /etc/httpd/conf/httpd.conf', + setype => $seltype_rw; + '/var/www/vhosts/[^/]*/logs(/.*)?': require => Package['apache'], - notify => Service['apache']; + setype => 'httpd_log_t'; } + } + file{'apache_service_config': + path => '/etc/sysconfig/httpd', + source => [ "puppet:///modules/site_apache/service/CentOS/${::fqdn}/httpd", + 'puppet:///modules/site_apache/service/CentOS/httpd', + 'puppet:///modules/apache/service/CentOS/httpd' ], + require => Package['apache'], + notify => Service['apache'], + owner => root, + group => 0, + mode => '0644'; + } - apache::config::global{'00-listen.conf': - ensure => absent, - } + # this is for later fixes + exec{ + 'adjust_pidfile': + command => 'sed -i "s/^#PidFile \(.*\)/PidFile \1/g" /etc/httpd/conf/httpd.conf', + unless => 'grep -qE \'^PidFile \' /etc/httpd/conf/httpd.conf', + require => Package['apache'], + notify => Service['apache']; + 'adjust_listen': + command => 'sed -i "s/^#Listen 80/Listen 80/g" /etc/httpd/conf/httpd.conf', + unless => 'grep -qE \'^Listen 80\' /etc/httpd/conf/httpd.conf', + require => Package['apache'], + notify => Service['apache']; + } + + apache::config::global{'00-listen.conf': + ensure => absent, + } - include apache::logrotate::centos + include apache::logrotate::centos - apache::config::global{ 'welcome.conf': } - apache::config::global{ 'vhosts.conf': } + apache::config::global{ 'welcome.conf': } + apache::config::global{ 'vhosts.conf': } } -- cgit v1.2.3