summaryrefslogtreecommitdiff
path: root/personal_infra/puppet/modules
diff options
context:
space:
mode:
authoralex <alex@pdp7.net>2023-08-29 18:47:16 +0000
committeralex <alex@pdp7.net>2023-08-29 18:48:20 +0000
commitdc69a74f8fec65e3f46d52c214e902942222efb5 (patch)
treea1adfdb984393e937fb3331f4f992e841291b28f /personal_infra/puppet/modules
parentcc0192e9baf953f118bf37ba3ab127ec35287634 (diff)
Allow http hosts and detect https automatically
Diffstat (limited to 'personal_infra/puppet/modules')
-rw-r--r--personal_infra/puppet/modules/proxmox/manifests/proxy_host.pp15
1 files changed, 12 insertions, 3 deletions
diff --git a/personal_infra/puppet/modules/proxmox/manifests/proxy_host.pp b/personal_infra/puppet/modules/proxmox/manifests/proxy_host.pp
index 658d4f4e..ab0cd69a 100644
--- a/personal_infra/puppet/modules/proxmox/manifests/proxy_host.pp
+++ b/personal_infra/puppet/modules/proxmox/manifests/proxy_host.pp
@@ -1,17 +1,26 @@
define proxmox::proxy_host (String[1] $target, Optional[String[1]] $overwrite_rh_certs = undef) {
+ if $target =~ /^https:/ {
+ $ssl_fragment = @("EOT")
+ SSLEngine on
+ SSLProxyEngine on
+ SSLProxyCheckPeerName off
+ | EOT
+ }
+ else {
+ $ssl_fragment = ""
+ }
+
file {"/etc/apache2/sites-enabled/$title.conf":
content => @("EOT")
MDomain $title
<VirtualHost *:443>
ServerName $title
- SSLEngine on
ProxyPass "/" "$target"
ProxyPassReverse "/" "$target"
ProxyPreservehost On
- SSLProxyEngine on
- SSLProxyCheckPeerName off
+ $ssl_fragment
</VirtualHost>
| EOT
,