diff --git a/manifests/init.pp b/manifests/init.pp index 4ee3b48..36913fd 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -4,6 +4,7 @@ class ptgbot( $nick, $password, $channel, + $vhost_name, ) { user { 'ptgbot': @@ -132,6 +133,15 @@ class ptgbot( replace => true, require => User['ptgbot'], } + + ::httpd::vhost { $vhost_name: + port => 80, + docroot => '/var/lib/ptgbot/www', + priority => '50', + template => 'ptgbot/vhost.erb', + require => File['/var/lib/ptgbot/www'], + } + } # vim:sw=2:ts=2:expandtab:textwidth=79 diff --git a/templates/vhost.erb b/templates/vhost.erb new file mode 100644 index 0000000..26bf135 --- /dev/null +++ b/templates/vhost.erb @@ -0,0 +1,18 @@ +# ************************************ +# Managed by Puppet +# ************************************ + + + ServerName <%= @vhost_name %> + DocumentRoot <%= @docroot %> + > + Options Indexes FollowSymLinks MultiViews + AllowOverride None + Satisfy Any + Require all granted + + LogLevel warn + ErrorLog /var/log/apache2/<%= @vhost_name %>_error.log + CustomLog /var/log/apache2/<%= @vhost_name %>_access.log combined + ServerSignature Off +