summaryrefslogtreecommitdiff
path: root/manifests/site
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2016-06-18 13:07:41 -0300
committerSilvio Rhatto <rhatto@riseup.net>2016-06-18 13:07:41 -0300
commitddf797eba5dac72742348247e539242a906ac672 (patch)
tree34ed9418111ec517f5b24e3b3e11bca14d3a4b0d /manifests/site
parent6b40dc405a167461fe39667d68772161980850cf (diff)
downloadpuppet-apache-ddf797eba5dac72742348247e539242a906ac672.tar.gz
puppet-apache-ddf797eba5dac72742348247e539242a906ac672.tar.bz2
Adds apache::site::config
Diffstat (limited to 'manifests/site')
-rw-r--r--manifests/site/config.pp47
1 files changed, 47 insertions, 0 deletions
diff --git a/manifests/site/config.pp b/manifests/site/config.pp
new file mode 100644
index 0000000..e084b46
--- /dev/null
+++ b/manifests/site/config.pp
@@ -0,0 +1,47 @@
+define apache::site::config(
+ $ensure = 'present',
+ $source = false,
+ $vhost = $name,
+ $template = 'apache/site.erb',
+) {
+ case $source {
+ true: {
+ file { "${apache::conf_sites}-available/$vhost.conf":
+ ensure => $ensure,
+ source => [ "puppet:///modules/site_apache/vhosts/${::domain}/${name}",
+ "puppet:///modules/site_apache/vhosts/${name}" ],
+ owner => root,
+ group => root,
+ mode => 0644,
+ require => File["${apache::macros}"],
+ notify => Service["apache"],
+ }
+ }
+ false: {
+ file { "${apache::conf_sites}-available/$vhost.conf":
+ ensure => $ensure,
+ content => template("$template"),
+ owner => root,
+ group => root,
+ mode => 0644,
+ require => File["${apache::macros}"],
+ notify => Service["apache"],
+ }
+ }
+ }
+
+ # Enable the site without a2ensite
+ #
+ #$status = $ensure ? {
+ # 'present' => "${apache::conf_sites}-available/$vhost.conf",
+ # default => 'absent',
+ #}
+ #
+ #file { "/etc/apache2/sites-enabled/$vhost.conf":
+ # ensure => $status,
+ # owner => root,
+ # group => root,
+ # require => File["${apache::conf_sites}-available/${name}"],
+ # notify => Service["apache"],
+ #}
+}