parent
5feb6e1d91
commit
049c3faada
4 changed files with 49 additions and 3 deletions
@ -0,0 +1,29 @@ |
|||||||
|
package MJB::Web::Task::UpdateSSLCerts; |
||||||
|
use Mojo::Base 'MJB::Web::Task', -signatures; |
||||||
|
use IPC::Run3; |
||||||
|
|
||||||
|
#== |
||||||
|
# This task pushes all of the let's encrypt ssl certs from certbot to |
||||||
|
# the webservers. It can be used after certificates have been renewed |
||||||
|
# to ensure they are on the webservers. |
||||||
|
# |
||||||
|
# It should be in the certbot queue. |
||||||
|
#== |
||||||
|
|
||||||
|
sub run ( $job ) { |
||||||
|
$job->note( _mds_template => 'update_ssl_certs' ); |
||||||
|
|
||||||
|
# Renew the SSL Certificates |
||||||
|
$job->system_command( [ 'sudo', 'letsencrypt renew' ] ); |
||||||
|
$job->note( is_renew_done => 1 ); |
||||||
|
|
||||||
|
# Push the SSL Certificates |
||||||
|
$job->system_command( [ 'sudo', 'letsencrypt-cert-push' ] ); |
||||||
|
|
||||||
|
$job->note( is_sync_done => 1 ); |
||||||
|
|
||||||
|
|
||||||
|
$job->finish(); |
||||||
|
} |
||||||
|
|
||||||
|
1; |
||||||
Loading…
Reference in new issue