Skip to content

Commit

Permalink
hack hack
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeni committed Sep 5, 2023
1 parent 13f35ce commit 00fcbe5
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 deletions.
12 changes: 1 addition & 11 deletions puppet/modules/redmine/manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
}
}
Expand Down
22 changes: 22 additions & 0 deletions vagrant/manifests/default.pp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
}
}

0 comments on commit 00fcbe5

Please sign in to comment.