From c653ce124758fb2d5f1d6ae1abfb0430ef6a9867 Mon Sep 17 00:00:00 2001 From: alex Date: Sun, 5 Mar 2023 20:42:33 +0100 Subject: Add initial Proxmox proxy --- .../puppet/modules/proxmox/manifests/proxy.pp | 47 ++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 personal_infra/puppet/modules/proxmox/manifests/proxy.pp (limited to 'personal_infra/puppet/modules/proxmox/manifests') diff --git a/personal_infra/puppet/modules/proxmox/manifests/proxy.pp b/personal_infra/puppet/modules/proxmox/manifests/proxy.pp new file mode 100644 index 00000000..423d5cfa --- /dev/null +++ b/personal_infra/puppet/modules/proxmox/manifests/proxy.pp @@ -0,0 +1,47 @@ +class proxmox::proxy ($mail, $base_hostname) { + package {'apache2':} + -> + service {'apache2': + enable => true, + ensure => running, + require => File['/usr/local/bin/notify_md_renewal'], + } + + $apache_dep = { + require => Package['apache2'], + notify => Service['apache2'], + } + + ['md', 'ssl'].each |$mod| { + exec {"/usr/sbin/a2enmod $mod": + creates => "/etc/apache2/mods-enabled/$mod.load", + * => $apache_dep, + } + } + + file {'/etc/apache2/sites-enabled/test.conf': + content => @("EOT") + MDomain $base_hostname + MDCertificateAgreement accepted + MDContactEmail $mail + MDNotifyCmd /usr/local/bin/notify_md_renewal + + + ServerName $base_hostname + SSLEngine on + + | EOT + , + * => $apache_dep + } + + file {'/usr/local/bin/notify_md_renewal': + content => @("EOT"/$) + #!/bin/sh + + mail $mail -s "Restart apache2 on $base_hostname for certificate \$1" '0755', + } +} -- cgit v1.2.3