Loading NEWS +4 −0 Original line number Diff line number Diff line release/001.013 (2015-03-31) Add support for apache 2.4 on Debian jessie systems. (whm) release/001.012 (2015-02-18) Rename self-signed class to self_signed for puppet3. (darrenp1) Loading manifests/conf.pp +49 −20 Original line number Diff line number Diff line Loading @@ -13,6 +13,10 @@ # # This has not yet been ported to Red Hat and is currently only available for # Debian. # # Supporting jessie requires significant changes. The conf.d directory # is no longer used and the files must be in conf-available and linked # from conf-enabled. define apache::conf( $ensure = 'present', Loading @@ -23,15 +27,39 @@ define apache::conf( if ($::operatingsystem != 'debian') and ($::operatingsystem != 'ubuntu') { fail("Unsupported apache::conf operating system ${::operatingsystem}") } if $lsbdistcodename == 'jessie' { # For jessie the $directory value is ignored. Everything must # be in /etc/apache2/conf-enabled if $name =~ /.conf$/ { $conf_id = $name } else { $conf_id = "${name}.conf" } # Install the file. file { "/etc/apache2/conf-available/$conf_id": ensure => $ensure, source => $source, content => $content, notify => Exec["a2enconf ${conf_id}"], } exec { "a2enconf ${conf_id}": command => "a2enconf ${conf_id}", refreshonly => true, require => File["/etc/apache2/conf-available/$conf_id"], notify => Exec['apache reload'], } } else { $parent = "/etc/apache2/${directory}" $realname = "${parent}/${name}" # Create the containing directory if it doesn't exist. This is a bit of a # hack, but a file resource would conflict with other apache::conf instances # in the same directory. # Create the containing directory if it doesn't exist. This is a # bit of a hack, but a file resource would conflict with other # apache::conf instances in the same directory. # # This always runs even on ensure => absent since otherwise we get errors # from the missing dependency. # This always runs even on ensure => absent since otherwise we get # errors from the missing dependency. exec { "mkparentdir ${realname}": command => "mkdir '${parent}'", creates => $parent, Loading @@ -47,3 +75,4 @@ define apache::conf( require => Exec["mkparentdir ${realname}"], } } } manifests/debian.pp +49 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,13 @@ # This manifest cleans up some of the default Apache configuration for Debian # that we don't want and installs some standard configuration we want to # always have available for all web servers. # # Jessie is a significant change to the way that apache servers are # configured. Create a completely new class to support it to make the # transition clearer. class apache::debian { # Releases wheezy and older class apache::debian::old { exec { 'a2dissite 000-default': command => 'a2dissite 000-default', onlyif => 'readlink /etc/apache2/sites-enabled/000-default | grep sites-available/default', Loading Loading @@ -37,3 +42,45 @@ class apache::debian { notify => Service['apache'], } } # Releases jessie and newer class apache::debian::new { exec { 'a2dissite 000-default.conf': command => 'a2dissite 000-default.conf', onlyif => 'readlink /etc/apache2/sites-enabled/000-default.conf', require => Package['apache'], } # Disable weak SSL ciphers. apache::conf { 'ssl-strength.conf': ensure => present, source => 'puppet:///modules/apache/etc/apache2/conf.d/ssl-strength', } # Replace the default Apache security configuration file with one that # suppresses most information disclosure about the server. apache::conf { 'security.conf': ensure => present, source => 'puppet:///modules/apache/etc/apache2/conf.d/security', } # Support /server-status for all virtual hosts, but only from localhost. apache::module { 'status': ensure => present, require => File['/etc/apache2/mods-available/status.conf'], } file { '/etc/apache2/mods-available/status.conf': source => 'puppet:///modules/apache/etc/apache2/mods-available/status.conf', require => Package['apache'], notify => Service['apache'], } } class apache::debian { if $lsbdistcodename == 'jessie' { include apache::debian::new } else { include apache::debian::old } } manifests/site.pp +20 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,20 @@ define apache::site( if !($ensure in [ 'present', 'absent' ]) { fail("ensure must be present or absent, not $ensure") } # With jessie the files controlled by a2ensite must have a suffix # of '.conf'. if ($::lsbdistcodename == 'jessie' and $name !~ /.conf$/) { $site_id = "${name}.conf" $realname = "/etc/apache2/sites-available/${name}.conf" file { "/etc/apache2/sites-available/${name}": ensure => absent; "/etc/apache2/sites-enabled/${name}": ensure => absent; } } else { $site_id = $name $realname = "/etc/apache2/sites-available/${name}" } # Install the site configuration. file { $realname: Loading @@ -36,16 +49,16 @@ define apache::site( # Enable or disable the site, based on the ensure parameter. if ($ensure == 'present') { exec { "a2ensite ${name}": command => "a2ensite ${name}", creates => "/etc/apache2/sites-enabled/${name}", exec { "a2ensite ${site_id}": command => "a2ensite ${site_id}", creates => "/etc/apache2/sites-enabled/${site_id}", require => [ Package['apache'], File[$realname] ], notify => Exec['apache reload'], } } elsif ($ensure == 'absent') { exec { "a2dissite ${name}": command => "a2dissite ${name}", unless => "[ ! -e '/etc/apache2/sites-enabled/${name}' ]", exec { "a2dissite ${site_id}": command => "a2dissite ${site_id}", unless => "[ ! -e '/etc/apache2/sites-enabled/${site_id}' ]", require => Package['apache'], notify => Exec['apache reload'], } Loading Loading
NEWS +4 −0 Original line number Diff line number Diff line release/001.013 (2015-03-31) Add support for apache 2.4 on Debian jessie systems. (whm) release/001.012 (2015-02-18) Rename self-signed class to self_signed for puppet3. (darrenp1) Loading
manifests/conf.pp +49 −20 Original line number Diff line number Diff line Loading @@ -13,6 +13,10 @@ # # This has not yet been ported to Red Hat and is currently only available for # Debian. # # Supporting jessie requires significant changes. The conf.d directory # is no longer used and the files must be in conf-available and linked # from conf-enabled. define apache::conf( $ensure = 'present', Loading @@ -23,15 +27,39 @@ define apache::conf( if ($::operatingsystem != 'debian') and ($::operatingsystem != 'ubuntu') { fail("Unsupported apache::conf operating system ${::operatingsystem}") } if $lsbdistcodename == 'jessie' { # For jessie the $directory value is ignored. Everything must # be in /etc/apache2/conf-enabled if $name =~ /.conf$/ { $conf_id = $name } else { $conf_id = "${name}.conf" } # Install the file. file { "/etc/apache2/conf-available/$conf_id": ensure => $ensure, source => $source, content => $content, notify => Exec["a2enconf ${conf_id}"], } exec { "a2enconf ${conf_id}": command => "a2enconf ${conf_id}", refreshonly => true, require => File["/etc/apache2/conf-available/$conf_id"], notify => Exec['apache reload'], } } else { $parent = "/etc/apache2/${directory}" $realname = "${parent}/${name}" # Create the containing directory if it doesn't exist. This is a bit of a # hack, but a file resource would conflict with other apache::conf instances # in the same directory. # Create the containing directory if it doesn't exist. This is a # bit of a hack, but a file resource would conflict with other # apache::conf instances in the same directory. # # This always runs even on ensure => absent since otherwise we get errors # from the missing dependency. # This always runs even on ensure => absent since otherwise we get # errors from the missing dependency. exec { "mkparentdir ${realname}": command => "mkdir '${parent}'", creates => $parent, Loading @@ -47,3 +75,4 @@ define apache::conf( require => Exec["mkparentdir ${realname}"], } } }
manifests/debian.pp +49 −2 Original line number Diff line number Diff line Loading @@ -3,8 +3,13 @@ # This manifest cleans up some of the default Apache configuration for Debian # that we don't want and installs some standard configuration we want to # always have available for all web servers. # # Jessie is a significant change to the way that apache servers are # configured. Create a completely new class to support it to make the # transition clearer. class apache::debian { # Releases wheezy and older class apache::debian::old { exec { 'a2dissite 000-default': command => 'a2dissite 000-default', onlyif => 'readlink /etc/apache2/sites-enabled/000-default | grep sites-available/default', Loading Loading @@ -37,3 +42,45 @@ class apache::debian { notify => Service['apache'], } } # Releases jessie and newer class apache::debian::new { exec { 'a2dissite 000-default.conf': command => 'a2dissite 000-default.conf', onlyif => 'readlink /etc/apache2/sites-enabled/000-default.conf', require => Package['apache'], } # Disable weak SSL ciphers. apache::conf { 'ssl-strength.conf': ensure => present, source => 'puppet:///modules/apache/etc/apache2/conf.d/ssl-strength', } # Replace the default Apache security configuration file with one that # suppresses most information disclosure about the server. apache::conf { 'security.conf': ensure => present, source => 'puppet:///modules/apache/etc/apache2/conf.d/security', } # Support /server-status for all virtual hosts, but only from localhost. apache::module { 'status': ensure => present, require => File['/etc/apache2/mods-available/status.conf'], } file { '/etc/apache2/mods-available/status.conf': source => 'puppet:///modules/apache/etc/apache2/mods-available/status.conf', require => Package['apache'], notify => Service['apache'], } } class apache::debian { if $lsbdistcodename == 'jessie' { include apache::debian::new } else { include apache::debian::old } }
manifests/site.pp +20 −7 Original line number Diff line number Diff line Loading @@ -23,7 +23,20 @@ define apache::site( if !($ensure in [ 'present', 'absent' ]) { fail("ensure must be present or absent, not $ensure") } # With jessie the files controlled by a2ensite must have a suffix # of '.conf'. if ($::lsbdistcodename == 'jessie' and $name !~ /.conf$/) { $site_id = "${name}.conf" $realname = "/etc/apache2/sites-available/${name}.conf" file { "/etc/apache2/sites-available/${name}": ensure => absent; "/etc/apache2/sites-enabled/${name}": ensure => absent; } } else { $site_id = $name $realname = "/etc/apache2/sites-available/${name}" } # Install the site configuration. file { $realname: Loading @@ -36,16 +49,16 @@ define apache::site( # Enable or disable the site, based on the ensure parameter. if ($ensure == 'present') { exec { "a2ensite ${name}": command => "a2ensite ${name}", creates => "/etc/apache2/sites-enabled/${name}", exec { "a2ensite ${site_id}": command => "a2ensite ${site_id}", creates => "/etc/apache2/sites-enabled/${site_id}", require => [ Package['apache'], File[$realname] ], notify => Exec['apache reload'], } } elsif ($ensure == 'absent') { exec { "a2dissite ${name}": command => "a2dissite ${name}", unless => "[ ! -e '/etc/apache2/sites-enabled/${name}' ]", exec { "a2dissite ${site_id}": command => "a2dissite ${site_id}", unless => "[ ! -e '/etc/apache2/sites-enabled/${site_id}' ]", require => Package['apache'], notify => Exec['apache reload'], } Loading