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:
|
||||
# FQDN of virtual host.
|
||||
# $site_root:
|
||||
# $root:
|
||||
# Path to document root. Defaults to /srv/www/http/$fqdn
|
||||
# $site_conf:
|
||||
# $config:
|
||||
# Path to custom configuration file. Defaults to a basic template.
|
||||
#
|
||||
# === Sample usage
|
||||
#
|
||||
# apache::site { "www.example.com":
|
||||
# site_root => "/roles/prteam/public/public_access",
|
||||
# site_conf => "puppet:///path/to/www.example.com.conf",
|
||||
# root => "/roles/prteam/public/public_access",
|
||||
# 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" {
|
||||
$site_fqdn = $fqdn
|
||||
} else {
|
||||
$site_fqdn = $name
|
||||
|
||||
if $site_root == "none" {
|
||||
if $root == "none" {
|
||||
file { "/srv/www/http/${site_fqdn}":
|
||||
ensure => directory,
|
||||
mode => 0755,
|
||||
|
@ -107,7 +107,7 @@ define apache::site($site_root="none", $site_conf="none") {
|
|||
} else {
|
||||
file { "/srv/www/http/${site_fqdn}":
|
||||
ensure => link,
|
||||
target => "${site_root}",
|
||||
target => "${root}",
|
||||
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"],
|
||||
}
|
||||
|
||||
if $site_conf == "none" {
|
||||
if $config == "none" {
|
||||
File["/etc/httpd/site.http.d/${site_fqdn}.conf"] {
|
||||
content => template("apache/site.http.conf.erb"),
|
||||
}
|
||||
} else {
|
||||
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:
|
||||
# FQDN of virtual host.
|
||||
# $site_root:
|
||||
# $root:
|
||||
# Path to document root. Defaults to /srv/www/https/$fqdn
|
||||
# $site_conf:
|
||||
# $config:
|
||||
# Path to custom configuration file. Defaults to a basic template.
|
||||
# $ssl_cert:
|
||||
# Path to SSL certificate. Defaults to puppetd's certificates.
|
||||
# Path to SSL certificate. Defaults to puppet client certificate.
|
||||
# $ssl_key:
|
||||
# Path to SSL private key. Defaults to puppetd's certificates.
|
||||
# Path to SSL private key. Defaults to puppet client certificate.
|
||||
# $ssl_chain:
|
||||
# Path to SSL certificate chain. Defaults to none.
|
||||
#
|
||||
# === Sample usage
|
||||
#
|
||||
# apache::site { "www.example.com":
|
||||
# site_root => "/roles/prteam/public/secure_access",
|
||||
# site_conf => "puppet:///path/to/www.example.com.conf",
|
||||
# ssl_cert => "puppet:///path/to/www.example.com.crt",
|
||||
# ssl_key => "puppet:///path/to/www.example.com.key",
|
||||
# root => "/roles/prteam/public/secure_access",
|
||||
# config => "puppet:///path/to/www.example.com.conf",
|
||||
# ssl_cert => "puppet:///path/to/www.example.com.crt",
|
||||
# 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") {
|
||||
|
||||
if $name == "default" {
|
||||
|
@ -228,7 +228,7 @@ define apache::sslsite($site_root="none", $site_conf="none",
|
|||
} else {
|
||||
$site_fqdn = $name
|
||||
|
||||
if $site_root == "none" {
|
||||
if $root == "none" {
|
||||
file { "/srv/www/https/${site_fqdn}":
|
||||
ensure => directory,
|
||||
mode => 0755,
|
||||
|
@ -238,7 +238,7 @@ define apache::sslsite($site_root="none", $site_conf="none",
|
|||
} else {
|
||||
file { "/srv/www/https/${site_fqdn}":
|
||||
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"], ],
|
||||
}
|
||||
|
||||
if $site_conf == "none" {
|
||||
if $config == "none" {
|
||||
File["/etc/httpd/site.https.d/${site_fqdn}.conf"] {
|
||||
content => template("apache/site.https.conf.erb"),
|
||||
}
|
||||
} else {
|
||||
File["/etc/httpd/site.https.d/${site_fqdn}.conf"] {
|
||||
source => "${site_conf}",
|
||||
source => "${config}",
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue