Cleaned up apache module.
This commit is contained in:
parent
d5e44df47e
commit
b221355896
3 changed files with 34 additions and 34 deletions
|
@ -77,26 +77,26 @@ class apache::server inherits apache::common {
|
||||||
#
|
#
|
||||||
# $name:
|
# $name:
|
||||||
# FQDN of virtual host.
|
# FQDN of virtual host.
|
||||||
# $site_root:
|
# $root:
|
||||||
# Path to document root. Defaults to /srv/www/http/$fqdn
|
# Path to document root. Defaults to /srv/www/http/$fqdn
|
||||||
# $site_conf:
|
# $config:
|
||||||
# Path to custom configuration file. Defaults to a basic template.
|
# Path to custom configuration file. Defaults to a basic template.
|
||||||
#
|
#
|
||||||
# === Sample usage
|
# === Sample usage
|
||||||
#
|
#
|
||||||
# apache::site { "www.example.com":
|
# apache::site { "www.example.com":
|
||||||
# site_root => "/roles/prteam/public/public_access",
|
# root => "/roles/prteam/public/public_access",
|
||||||
# site_conf => "puppet:///path/to/www.example.com.conf",
|
# config => "puppet:///path/to/www.example.com.conf",
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
define apache::site($site_root="none", $site_conf="none") {
|
define apache::site($root="none", $config="none") {
|
||||||
|
|
||||||
if $name == "default" {
|
if $name == "default" {
|
||||||
$site_fqdn = $fqdn
|
$site_fqdn = $fqdn
|
||||||
} else {
|
} else {
|
||||||
$site_fqdn = $name
|
$site_fqdn = $name
|
||||||
|
|
||||||
if $site_root == "none" {
|
if $root == "none" {
|
||||||
file { "/srv/www/http/${site_fqdn}":
|
file { "/srv/www/http/${site_fqdn}":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
mode => 0755,
|
mode => 0755,
|
||||||
|
@ -107,7 +107,7 @@ define apache::site($site_root="none", $site_conf="none") {
|
||||||
} else {
|
} else {
|
||||||
file { "/srv/www/http/${site_fqdn}":
|
file { "/srv/www/http/${site_fqdn}":
|
||||||
ensure => link,
|
ensure => link,
|
||||||
target => "${site_root}",
|
target => "${root}",
|
||||||
before => File["/etc/httpd/site.http.d/${site_fqdn}.conf"],
|
before => File["/etc/httpd/site.http.d/${site_fqdn}.conf"],
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -126,13 +126,13 @@ define apache::site($site_root="none", $site_conf="none") {
|
||||||
notify => Service["httpd"],
|
notify => Service["httpd"],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $site_conf == "none" {
|
if $config == "none" {
|
||||||
File["/etc/httpd/site.http.d/${site_fqdn}.conf"] {
|
File["/etc/httpd/site.http.d/${site_fqdn}.conf"] {
|
||||||
content => template("apache/site.http.conf.erb"),
|
content => template("apache/site.http.conf.erb"),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
File["/etc/httpd/site.http.d/${site_fqdn}.conf"] {
|
File["/etc/httpd/site.http.d/${site_fqdn}.conf"] {
|
||||||
source => "${site_conf}",
|
source => "${config}",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -200,27 +200,27 @@ class apache::sslserver inherits apache::common {
|
||||||
#
|
#
|
||||||
# $name:
|
# $name:
|
||||||
# FQDN of virtual host.
|
# FQDN of virtual host.
|
||||||
# $site_root:
|
# $root:
|
||||||
# Path to document root. Defaults to /srv/www/https/$fqdn
|
# Path to document root. Defaults to /srv/www/https/$fqdn
|
||||||
# $site_conf:
|
# $config:
|
||||||
# Path to custom configuration file. Defaults to a basic template.
|
# Path to custom configuration file. Defaults to a basic template.
|
||||||
# $ssl_cert:
|
# $ssl_cert:
|
||||||
# Path to SSL certificate. Defaults to puppetd's certificates.
|
# Path to SSL certificate. Defaults to puppet client certificate.
|
||||||
# $ssl_key:
|
# $ssl_key:
|
||||||
# Path to SSL private key. Defaults to puppetd's certificates.
|
# Path to SSL private key. Defaults to puppet client certificate.
|
||||||
# $ssl_chain:
|
# $ssl_chain:
|
||||||
# Path to SSL certificate chain. Defaults to none.
|
# Path to SSL certificate chain. Defaults to none.
|
||||||
#
|
#
|
||||||
# === Sample usage
|
# === Sample usage
|
||||||
#
|
#
|
||||||
# apache::site { "www.example.com":
|
# apache::site { "www.example.com":
|
||||||
# site_root => "/roles/prteam/public/secure_access",
|
# root => "/roles/prteam/public/secure_access",
|
||||||
# site_conf => "puppet:///path/to/www.example.com.conf",
|
# config => "puppet:///path/to/www.example.com.conf",
|
||||||
# ssl_cert => "puppet:///path/to/www.example.com.crt",
|
# ssl_cert => "puppet:///path/to/www.example.com.crt",
|
||||||
# ssl_key => "puppet:///path/to/www.example.com.key",
|
# ssl_key => "puppet:///path/to/www.example.com.key",
|
||||||
# }
|
# }
|
||||||
#
|
#
|
||||||
define apache::sslsite($site_root="none", $site_conf="none",
|
define apache::sslsite($root="none", $config="none",
|
||||||
$ssl_cert="none", $ssl_key="none", $ssl_chain="none") {
|
$ssl_cert="none", $ssl_key="none", $ssl_chain="none") {
|
||||||
|
|
||||||
if $name == "default" {
|
if $name == "default" {
|
||||||
|
@ -228,7 +228,7 @@ define apache::sslsite($site_root="none", $site_conf="none",
|
||||||
} else {
|
} else {
|
||||||
$site_fqdn = $name
|
$site_fqdn = $name
|
||||||
|
|
||||||
if $site_root == "none" {
|
if $root == "none" {
|
||||||
file { "/srv/www/https/${site_fqdn}":
|
file { "/srv/www/https/${site_fqdn}":
|
||||||
ensure => directory,
|
ensure => directory,
|
||||||
mode => 0755,
|
mode => 0755,
|
||||||
|
@ -238,7 +238,7 @@ define apache::sslsite($site_root="none", $site_conf="none",
|
||||||
} else {
|
} else {
|
||||||
file { "/srv/www/https/${site_fqdn}":
|
file { "/srv/www/https/${site_fqdn}":
|
||||||
ensure => link,
|
ensure => link,
|
||||||
target => "${site_root}",
|
target => "${root}",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -298,13 +298,13 @@ define apache::sslsite($site_root="none", $site_conf="none",
|
||||||
File["/etc/pki/tls/private/${site_fqdn}.key"], ],
|
File["/etc/pki/tls/private/${site_fqdn}.key"], ],
|
||||||
}
|
}
|
||||||
|
|
||||||
if $site_conf == "none" {
|
if $config == "none" {
|
||||||
File["/etc/httpd/site.https.d/${site_fqdn}.conf"] {
|
File["/etc/httpd/site.https.d/${site_fqdn}.conf"] {
|
||||||
content => template("apache/site.https.conf.erb"),
|
content => template("apache/site.https.conf.erb"),
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
File["/etc/httpd/site.https.d/${site_fqdn}.conf"] {
|
File["/etc/httpd/site.https.d/${site_fqdn}.conf"] {
|
||||||
source => "${site_conf}",
|
source => "${config}",
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -568,12 +568,12 @@ Alias /icons/ "/var/www/icons/"
|
||||||
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
|
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
|
||||||
# CGI directory exists, if you have that configured.
|
# CGI directory exists, if you have that configured.
|
||||||
#
|
#
|
||||||
<Directory "/var/www/cgi-bin">
|
#<Directory "/var/www/cgi-bin">
|
||||||
AllowOverride None
|
# AllowOverride None
|
||||||
Options None
|
# Options None
|
||||||
Order allow,deny
|
# Order allow,deny
|
||||||
Allow from all
|
# Allow from all
|
||||||
</Directory>
|
#</Directory>
|
||||||
|
|
||||||
#
|
#
|
||||||
# Redirect allows you to tell clients about documents which used to exist in
|
# Redirect allows you to tell clients about documents which used to exist in
|
||||||
|
|
|
@ -568,12 +568,12 @@ Alias /icons/ "/var/www/icons/"
|
||||||
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
|
# "/var/www/cgi-bin" should be changed to whatever your ScriptAliased
|
||||||
# CGI directory exists, if you have that configured.
|
# CGI directory exists, if you have that configured.
|
||||||
#
|
#
|
||||||
<Directory "/var/www/cgi-bin">
|
#<Directory "/var/www/cgi-bin">
|
||||||
AllowOverride None
|
# AllowOverride None
|
||||||
Options None
|
# Options None
|
||||||
Order allow,deny
|
# Order allow,deny
|
||||||
Allow from all
|
# Allow from all
|
||||||
</Directory>
|
#</Directory>
|
||||||
|
|
||||||
#
|
#
|
||||||
# Redirect allows you to tell clients about documents which used to exist in
|
# Redirect allows you to tell clients about documents which used to exist in
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue