From 064fe099898269ee232edf7bb9803c86389b8980 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 11 Jul 2020 01:55:11 -0400 Subject: factor cron jobs out into a helper module --- modules/certbot/manifests/init.pp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'modules/certbot') diff --git a/modules/certbot/manifests/init.pp b/modules/certbot/manifests/init.pp index 8f3b4cb..200b854 100644 --- a/modules/certbot/manifests/init.pp +++ b/modules/certbot/manifests/init.pp @@ -6,7 +6,6 @@ class certbot($config_dir=undef) { $_config_dir = "/etc/letsencrypt" } - include cron include nginx $primary_domain = "tozt.net" @@ -31,13 +30,6 @@ class certbot($config_dir=undef) { } file { - '/etc/cron.daily/certbot': - content => template('certbot/certbot'), - mode => '0755', - require => [ - Package['certbot'], - Class['cron'], - ]; "${_config_dir}/renewal-hooks": ensure => directory, require => Package['certbot']; @@ -59,6 +51,12 @@ class certbot($config_dir=undef) { mode => '0755'; } + cron::job { "certbot": + frequency => "daily", + content => template('certbot/certbot'), + require => Package['certbot']; + } + exec { "initial certbot run": provider => shell, command => "/usr/local/bin/certbot-tozt ${config_dir}", -- cgit v1.2.3-54-g00ecf