From 9ea8edc3411d7be03fac78810ed9268574156ef9 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Thu, 6 Jun 2019 14:36:56 -0700 Subject: [PATCH] Evaluate files website vhosts in context of website not vhost To deal with puppet scoping fun we evaluate the template for our files.o.o website vhosts in the context of the website define and not in the context of httpd::vhost. Change-Id: I90bb881eb6ad78cede3a8a2548e1dfcf24e1160b --- .../openstack_project/manifests/website.pp | 2 +- .../templates/website.vhost.erb | 26 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/openstack_project/manifests/website.pp b/modules/openstack_project/manifests/website.pp index eae4467b95..12a0b16f3f 100644 --- a/modules/openstack_project/manifests/website.pp +++ b/modules/openstack_project/manifests/website.pp @@ -44,7 +44,7 @@ define openstack_project::website ( port => 443, # Is required despite not being used. docroot => $docroot_, priority => '50', - template => $template, + content => template($template) } if ($ssl_cert != undef) { diff --git a/modules/openstack_project/templates/website.vhost.erb b/modules/openstack_project/templates/website.vhost.erb index 62306406b8..de94c696a6 100644 --- a/modules/openstack_project/templates/website.vhost.erb +++ b/modules/openstack_project/templates/website.vhost.erb @@ -3,15 +3,15 @@ # ************************************ - ServerName <%= @srvname %> - <% if @serveraliases.is_a? Array -%> - <% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%> - <% elsif @serveraliases != nil -%> - <%= " ServerAlias #{@serveraliases}" -%> + ServerName <%= @name %> + <% if @aliases.is_a? Array -%> + <% @aliases.each do |alias_name| -%><%= " ServerAlias #{alias_name}\n" %><% end -%> + <% elsif @aliases != nil -%> + <%= " ServerAlias #{@aliases}" -%> <% end -%> RewriteEngine on - RewriteRule ^/(.*) https://<%= @srvname %>/$1 [last,redirect=permanent] + RewriteRule ^/(.*) https://<%= @name %>/$1 [last,redirect=permanent] ErrorLog /var/log/<%= scope.lookupvar("httpd::params::apache_name") %>/<%= @name %>_error.log LogLevel warn @@ -21,11 +21,11 @@ - ServerName <%= @srvname %> - <% if @serveraliases.is_a? Array -%> - <% @serveraliases.each do |name| -%><%= " ServerAlias #{name}\n" %><% end -%> - <% elsif @serveraliases != nil -%> - <%= " ServerAlias #{@serveraliases}" -%> + ServerName <%= @name %> + <% if @aliases.is_a? Array -%> + <% @aliases.each do |alias_name| -%><%= " ServerAlias #{alias_name}\n" %><% end -%> + <% elsif @aliases != nil -%> + <%= " ServerAlias #{@aliases}" -%> <% end -%> RewriteEngine on @@ -41,8 +41,8 @@ SSLCertificateKeyFile <%= @ssl_key_file_ %> SSLCertificateChainFile <%= @ssl_chain_file_ %> - DocumentRoot <%= @docroot %> - > + DocumentRoot <%= @docroot_ %> + > Options Indexes FollowSymLinks MultiViews Satisfy any Require all granted