Real sync ssl task.

master
Kaitlyn Parkhurst 3 years ago
parent 6827312718
commit 6608b32157
  1. 8
      Web/lib/MJB/Web/Task/CreateSSLCert.pm
  2. 10
      Web/lib/MJB/Web/Task/SyncSSLCerts.pm
  3. 8
      Web/lib/MJB/Web/Task/UpdateSSLCerts.pm
  4. 8
      Web/lib/MJB/Web/Task/WildCardSSL.pm

@ -22,9 +22,11 @@ sub run ( $job, $blog_id ) {
$job->note( is_create_done => 1 ); $job->note( is_create_done => 1 );
# Push the SSL Certs to all hosts # Push the SSL Certs to all hosts
my $result_sync = $job->system_command( [ my $id = $job->app->minion->enqueue( 'sync_ssl_certs', [ ], {
qw(sudo letsencrypt-cert-push) queue => 'certbot',
]); notes => { '_bid_0' => 1 },
});
$job->app->db->admin_jobs->create({ minion_job_id => $id });
$job->note( is_sync_done => 1 ); $job->note( is_sync_done => 1 );

@ -13,8 +13,14 @@ use IPC::Run3;
sub run ( $job ) { sub run ( $job ) {
$job->note( _job_template => 'sync_ssl_certs' ); $job->note( _job_template => 'sync_ssl_certs' );
# Push the SSL Certificates my $servers = $job->app->db->servers;
my $result = $job->system_command( [ 'sudo', 'letsencrypt-cert-push' ] ); my $source = '/etc/letsencrypt/live';
my $ssh_opt = 'ssh -o StrictHostKeyChecking=no';
while ( my $server = $servers->next ) {
my $dest = "root@" . $server->hostname . ":/etc/letsencrypt";
$job->system_command( [ qw( rsync -vrLptgoD --delete -e ), $ssh_opt, $source, $dest ]);
}
$job->note( is_sync_done => 1 ); $job->note( is_sync_done => 1 );

@ -17,8 +17,12 @@ sub run ( $job ) {
$job->system_command( [ 'sudo', 'certbot', 'renew' ] ); $job->system_command( [ 'sudo', 'certbot', 'renew' ] );
$job->note( is_renew_done => 1 ); $job->note( is_renew_done => 1 );
# Push the SSL Certificates # Push the SSL Certs to all hosts
$job->system_command( [ 'sudo', 'letsencrypt-cert-push' ] ); my $id = $job->app->minion->enqueue( 'sync_ssl_certs', [ ], {
queue => 'certbot',
notes => { '_bid_0' => 1 },
});
$job->app->db->admin_jobs->create({ minion_job_id => $id });
$job->note( is_sync_done => 1 ); $job->note( is_sync_done => 1 );

@ -22,9 +22,11 @@ sub run ( $job, $hosted_domain_id ) {
$job->note( is_create_done => 1 ); $job->note( is_create_done => 1 );
# Push the SSL Certs to all hosts # Push the SSL Certs to all hosts
my $result_sync = $job->system_command( [ my $id = $job->app->minion->enqueue( 'sync_ssl_certs', [ ], {
qw(sudo letsencrypt-cert-push) queue => 'certbot',
]); notes => { '_bid_0' => 1 },
});
$job->app->db->admin_jobs->create({ minion_job_id => $id });
$job->note( is_sync_done => 1 ); $job->note( is_sync_done => 1 );

Loading…
Cancel
Save