File tree Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Expand file tree Collapse file tree 3 files changed +25
-0
lines changed Original file line number Diff line number Diff line change 1+ # Managed by Puppet
2+ LOCKFILE=" /var/lock/certbot"
3+ LOCKFD=99
4+ # private
5+ function _lock() { flock " $@ " $LOCKFD ; }
6+ function _release_lock() { _lock -u; _lock -xn && rm -f $LOCKFILE ; }
7+ function _prepare_lock() { eval " exec $LOCKFD >\" $LOCKFILE \" " ; trap _release_lock EXIT; }
8+
9+ # on start
10+ _prepare_lock
11+
12+ # public
13+ function exlock() { _lock -x --timeout 30; } # obtain an exclusive lock
14+ function unlock() { _lock -u; } # drop a lock
Original file line number Diff line number Diff line change 9292
9393 contain letsencrypt::renew
9494
95+ file { '/usr/share/certbot_lock.sh' :
96+ ensure => file ,
97+ mode => ' 0544' ,
98+ content => file (" ${module_name} /certbot_lock.sh" ),
99+ }
100+
95101 $certificates .each |$certificate , $properties | {
96102 letsencrypt::certonly { $certificate: * => $properties }
97103 }
Original file line number Diff line number Diff line change 22< %- @environment.each do | environment| -%>
33export < %= environment %>
44< %- end -%>
5+ if [ -f ' /usr/share/certbot_lock.sh' ]; then
6+ . ' /usr/share/misc/certbot_lock.sh'
7+ fi
8+ exlock
59< %= @cron_cmd %>
10+ unlock
You can’t perform that action at this time.
0 commit comments