Created
May 22, 2012 13:12
-
-
Save ottomata/2768958 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Enables a certain Lighttpd config | |
define lighttpd_config($install="false") { | |
if $install == "true" { | |
file { "/etc/lighttpd/conf-available/${title}.conf": | |
source => "puppet:///files/lighttpd/${title}.conf", | |
owner => root, | |
group => www-data, | |
mode => 0444, | |
before => File["/etc/lighttpd/conf-enabled/${title}.conf"]; | |
} | |
} | |
file { "/etc/lighttpd/conf-enabled/${title}.conf": | |
ensure => "/etc/lighttpd/conf-available/${title}.conf"; | |
} | |
# Reload lighttpd if the site config file changes. | |
# This subscribes to both the real file and the symlink. | |
# Not sure if this is the best thing to do. What's up with the | |
# $install boolean above? | |
exec { "lighttpd_reload_${title}": | |
command => "/usr/sbin/service service lighttpd reload", | |
refreshonly => true, | |
subscribe => [File["/etc/lighttpd/conf-enabled/${title}.conf"], | |
File["/etc/lighttpd/conf-available/${title}.conf"]], | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment