|
|
|
|
@ -13,8 +13,14 @@ use IPC::Run3; |
|
|
|
|
sub run ( $job ) { |
|
|
|
|
$job->note( _job_template => 'sync_ssl_certs' ); |
|
|
|
|
|
|
|
|
|
# Push the SSL Certificates |
|
|
|
|
my $result = $job->system_command( [ 'sudo', 'letsencrypt-cert-push' ] ); |
|
|
|
|
my $servers = $job->app->db->servers; |
|
|
|
|
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 ); |
|
|
|
|
|
|
|
|
|
|