puppet-storyboard/templates/storyboard_http.vhost.erb
Colleen Murphy 6153eec795 Fix scope of vhost template variables
Dynamic scoping for variables in ERB templates was removed in puppet
4[1] which means that the variables defined in the manifests cannot be
found when it is referenced in the httpd::vhost defined type and will be
evaluated as nil when puppet runs. Use scope.lookupvar instead to be
explicit about the variable's source.

[1] https://puppet.com/docs/puppet/4.10/lang_updating_manifests.html#dynamic-scoping-in-erb

Change-Id: I007975c920bd12a352acdea742b841a17ecc5d17
2018-04-27 21:24:23 +02:00

26 lines
1.0 KiB
Plaintext

<VirtualHost *:80>
<% if scope.lookupvar("storyboard::application::server_admin") != :undef %>
ServerAdmin <%= scope.lookupvar("storyboard::application::server_admin") %>
<% end %>
ServerName <%= scope.lookupvar("storyboard::application::hostname") %>
DocumentRoot <%= scope.lookupvar("storyboard::application::www_root") %>
WSGIDaemonProcess storyboard user=<%= scope.lookupvar("storyboard::params::user") %> group=<%= scope.lookupvar("storyboard::params::group") %> threads=5 python-path=/usr/local/lib/python2.7/dist-packages
WSGIScriptAlias /api /var/lib/storyboard/storyboard.wsgi
WSGIPassAuthorization On
LogLevel warn
ErrorLog ${APACHE_LOG_DIR}/storyboard-error.log
CustomLog ${APACHE_LOG_DIR}/storyboard-access.log combined
<Directory "<%= scope.lookupvar("storyboard::application::install_root") %>">
<% if scope.lookupvar("storyboard::application::new_vhost_perms") %>
Require all granted
<% else %>
Order allow,deny
Allow from all
<% end %>
</Directory>
</VirtualHost>