From 61a9719162440351634e5b11da33169eb2dae660 Mon Sep 17 00:00:00 2001 From: Jan Dittberner Date: Sat, 6 Jun 2020 12:36:27 +0200 Subject: Fix template file name The puppet template function expects templates to be named *.epp. This commit fixes this by renaming the template and using the .epp name explicitly. --- sitemodules/profiles/manifests/nginx_revproxy.pp | 2 +- .../templates/nginx_revproxy/virtual_host.nginx | 31 ---------------------- .../nginx_revproxy/virtual_host.nginx.epp | 31 ++++++++++++++++++++++ 3 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx create mode 100644 sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx.epp (limited to 'sitemodules') diff --git a/sitemodules/profiles/manifests/nginx_revproxy.pp b/sitemodules/profiles/manifests/nginx_revproxy.pp index d92bc5e..8bc4f94 100644 --- a/sitemodules/profiles/manifests/nginx_revproxy.pp +++ b/sitemodules/profiles/manifests/nginx_revproxy.pp @@ -60,7 +60,7 @@ class profiles::nginx_revproxy ( owner => 'root', group => 'root', mode => '0644', - content => epp('profiles/nginx_revproxy/virtual_host.nginx', + content => epp('profiles/nginx_revproxy/virtual_host.nginx.epp', { 'virtual_host' => $vhost, 'target' => $virtual_host['target'], diff --git a/sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx b/sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx deleted file mode 100644 index 2173adf..0000000 --- a/sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx +++ /dev/null @@ -1,31 +0,0 @@ -<%- | String $virtual_host, - String $target, - String $custom_config, -| -%> -# THIS FILE IS MANAGED BY PUPPET, MANUAL CHANGES WILL BE OVERWRITTEN AT THE -# NEXT PUPPET RUN. - -server { - listen 80; - listen [::]:80; - - listen 443 ssl; - listen [::]:443 ssl; - - if ($https != "on") { - return 301 https://$host$uri; - } - - ssl_certificate /etc/ssl/public/<%= $virtual_host %>.chain.pem; - ssl_certificate_key /etc/ssl/private/<%= $virtual_host %>.key.pem; - - access_log /var/log/nginx/<%= $virtual_host %>.access.log; - error_log /var/log/nginx/<%= $virtual_host %>.error.log; - - server_name <%= $virtual_hosts %>; - <%= $custom_config -%> - - location / { - proxy_pass <%= $target %>; - } -} diff --git a/sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx.epp b/sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx.epp new file mode 100644 index 0000000..2173adf --- /dev/null +++ b/sitemodules/profiles/templates/nginx_revproxy/virtual_host.nginx.epp @@ -0,0 +1,31 @@ +<%- | String $virtual_host, + String $target, + String $custom_config, +| -%> +# THIS FILE IS MANAGED BY PUPPET, MANUAL CHANGES WILL BE OVERWRITTEN AT THE +# NEXT PUPPET RUN. + +server { + listen 80; + listen [::]:80; + + listen 443 ssl; + listen [::]:443 ssl; + + if ($https != "on") { + return 301 https://$host$uri; + } + + ssl_certificate /etc/ssl/public/<%= $virtual_host %>.chain.pem; + ssl_certificate_key /etc/ssl/private/<%= $virtual_host %>.key.pem; + + access_log /var/log/nginx/<%= $virtual_host %>.access.log; + error_log /var/log/nginx/<%= $virtual_host %>.error.log; + + server_name <%= $virtual_hosts %>; + <%= $custom_config -%> + + location / { + proxy_pass <%= $target %>; + } +} -- cgit v1.2.1