From 00fcbe5565854229879ca550a637b4800d859299 Mon Sep 17 00:00:00 2001 From: Evgeni Golov Date: Tue, 5 Sep 2023 10:49:28 +0200 Subject: [PATCH] hack hack --- puppet/modules/redmine/manifests/init.pp | 12 +----------- vagrant/manifests/default.pp | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/puppet/modules/redmine/manifests/init.pp b/puppet/modules/redmine/manifests/init.pp index 817391211..63c529dd1 100644 --- a/puppet/modules/redmine/manifests/init.pp +++ b/puppet/modules/redmine/manifests/init.pp @@ -223,13 +223,6 @@ } if $https { - letsencrypt::certonly { $servername: - plugin => 'webroot', - domains => [$servername], - webroot_paths => [$docroot], - require => Vcsrepo[$app_root], - } - apache::vhost { "${servername}-https": add_default_charset => 'UTF-8', docroot => $docroot, @@ -239,13 +232,10 @@ priority => $priority, servername => $servername, ssl => true, - ssl_cert => "/etc/letsencrypt/live/${servername}/fullchain.pem", - ssl_chain => "/etc/letsencrypt/live/${servername}/chain.pem", - ssl_key => "/etc/letsencrypt/live/${servername}/privkey.pem", headers => [ 'set Strict-Transport-Security: max-age=15778800;', ], - require => [Letsencrypt::Certonly[$servername], Exec['install redmine']], + require => [Exec['install redmine']], * => $apache_backend_config, } } diff --git a/vagrant/manifests/default.pp b/vagrant/manifests/default.pp index fa08543ca..c71d9dd70 100644 --- a/vagrant/manifests/default.pp +++ b/vagrant/manifests/default.pp @@ -20,4 +20,26 @@ node /^redmine.*/ { include profiles::redmine + + # Not /etc/foreman because purging removes that + $certificate = "/etc/pki/tls/certs/localhost.crt" + $key = "/etc/pki/tls/private/localhost.key" + + exec { 'Generate certificate': + command => "openssl req -nodes -x509 -newkey rsa:2048 -subj '/CN=${facts['networking']['fqdn']}' -keyout '${key}' -out '${certificate}' -days 365", + path => ['/bin', '/usr/bin'], + creates => $certificate, + umask => '0022', + } + -> file { [$key, $certificate]: + owner => 'root', + group => 'apache', + mode => '0640', + } + + class {'redmine': + repo_branch => 'new-redmine', + deployment => 'puma', + https => true, + } }