diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2009-12-24 19:31:31 -0200 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2009-12-24 19:31:31 -0200 |
commit | 341a21e01660c4856898c8a7131dce05763e8c6b (patch) | |
tree | 4fbb441528e6fb22cf464679f450c5076c63b248 | |
parent | 3d80a9fc39137f235c0527d77acfa4c4e4706624 (diff) | |
download | puppet-apache-341a21e01660c4856898c8a7131dce05763e8c6b.tar.gz puppet-apache-341a21e01660c4856898c8a7131dce05763e8c6b.tar.bz2 |
Adding source parameter
-rw-r--r-- | manifests/init.pp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/manifests/init.pp b/manifests/init.pp index 33c8d27..4cdbe02 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -84,15 +84,29 @@ class apache { define site($ensure = present, $docroot = false, $redirect = false, $redirect_match = false, $protocol = 'http', - $server_alias = false, $use = false, $ticket = false) { - file { "${apache2_sites}-available/$title": - ensure => $ensure, - content => template('apache/site.erb'), - owner => root, - group => root, - mode => 0644, - require => File["${apache2_macros}"], - notify => Service["apache"], + $server_alias = false, $use = false, $ticket = false, + $source = false) { + + if $source { + file { "${apache2_sites}-available/$title": + ensure => $ensure, + source => $source, + owner => root, + group => root, + mode => 0644, + require => File["${apache2_macros}"], + notify => Service["apache"], + } + } else { + file { "${apache2_sites}-available/$title": + ensure => $ensure, + content => template('apache/site.erb'), + owner => root, + group => root, + mode => 0644, + require => File["${apache2_macros}"], + notify => Service["apache"], + } } $status = $ensure ? { |