Skip to content
Snippets Groups Projects
Commit c00c7b81 authored by Henrik Henriksson's avatar Henrik Henriksson
Browse files

Automatically update ssl-certificates

parent 2d61a012
No related branches found
No related tags found
No related merge requests found
...@@ -6,10 +6,12 @@ class insidan::certificates { ...@@ -6,10 +6,12 @@ class insidan::certificates {
letsencrypt::certonly { 'insidan.holgerspexet.se': letsencrypt::certonly { 'insidan.holgerspexet.se':
domains => [ 'insidan.holgerspexet.se', domains => [ 'insidan.holgerspexet.se',
'holgerspexet.lysator.liu.se', 'holgerspexet.lysator.liu.se',
'holgerspexet.se',
'www.holgerspexet.se',
], ],
manage_cron => true,
suppress_cron_output => true, suppress_cron_output => true,
cron_success_command => '/bin/systemctl restart nginx', cron_hour => '4',
cron_minute => '13',
pre_hook_commands => ['/bin/systemctl stop nginx',],
post_hook_commands => ['/bin/systemctl restart nginx',],
} }
} }
...@@ -41,10 +41,9 @@ class insidan::openproject { ...@@ -41,10 +41,9 @@ class insidan::openproject {
# Setup Nginx # Setup Nginx
nginx::resource::server { 'insidan.holgerspexet.se': nginx::resource::server { 'insidan.holgerspexet.se':
require => [ Class['::insidan::certificates'], ],
server_name => ['insidan.holgerspexet.se'], server_name => ['insidan.holgerspexet.se'],
proxy => 'http://localhost:6000', proxy => 'http://localhost:6000',
......
class wordpress::certificates {
class { '::letsencrypt':
email => 'hx@hx.ax', # Putting in my personal email for now
}
letsencrypt::certonly { 'holgerspexet.se':
domains => [ 'holgerspexet.se',
'holgerspexet-public.lysator.liu.se',
'www.holgerspexet.se',
],
manage_cron => true,
suppress_cron_output => true,
cron_hour => '4',
cron_minute => '17',
pre_hook_commands => ['/bin/systemctl stop apache',],
post_hook_commands => ['/bin/systemctl restart apache || true',],
# '||true' for initial bootstrap. pls fix
}
}
...@@ -7,9 +7,12 @@ class wordpress { ...@@ -7,9 +7,12 @@ class wordpress {
ensure => directory, ensure => directory,
} }
include wordpress::certificates;
class { 'apache': class { 'apache':
default_vhost => false, default_vhost => false,
mpm_module => 'prefork', mpm_module => 'prefork',
require => [ Class['::wordpress::certificates'], ],
} }
include apache::mod::rewrite include apache::mod::rewrite
...@@ -66,18 +69,5 @@ class wordpress { ...@@ -66,18 +69,5 @@ class wordpress {
redirect_status => 'permanent', redirect_status => 'permanent',
redirect_dest => 'https://dev.holgerspexet.se', redirect_dest => 'https://dev.holgerspexet.se',
} }
class { '::letsencrypt':
email => 'hx@hx.ax', # Putting in my personal email for now
} }
letsencrypt::certonly { 'holgerspexet.se':
domains => [ 'holgerspexet.se',
'holgerspexet-public.lysator.liu.se',
'www.holgerspexet.se',
],
suppress_cron_output => true,
cron_success_command => '/bin/systemctl restart nginx',
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment