Skip to content

Instantly share code, notes, and snippets.

@ottomata
Created May 22, 2012 13:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ottomata/2768958 to your computer and use it in GitHub Desktop.
Save ottomata/2768958 to your computer and use it in GitHub Desktop.
# 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