Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emmapeel
puppet-tails
Commits
9af5f53a
Commit
9af5f53a
authored
Jul 09, 2020
by
intrigeri
Browse files
Merge remote-tracking branch 'origin/master' into update-jenkins-core-and-plugins
parents
098f7023
7370670c
Changes
2
Hide whitespace changes
Inline
Side-by-side
manifests/check_mirrors.pp
View file @
9af5f53a
...
...
@@ -70,23 +70,28 @@ class tails::check_mirrors (
],
}
cron { '
tails_check_mirrors
':
command => "sleep \$(( \$( </dev/urandom od -N2 -t u2 -A none ) >> 5 )) && \"${repo_checkout}/check-mirrors.rb\"",
user => $user,
hour => 0,
minute => 16,
require => [Vcsrepo[$repo_checkout], Package[$needed_packages],
Postfix::Mailalias[$user], Exec['
Import
Tails
signing
key
']],
# By default, check-mirrors.rb would create its per-run temporary
# directory in $CWD, i.e. in this context $HOME, which is never
# cleaned up automatically; so interrupted runs would leave
# temporary files behind them forever. Let'
s
ask
check
-
mirrors
.
rb
#
to
instead
create
its
per
-
run
temporary
directory
in
a
place
#
that
is
cleaned
up
on
boot
.
This
requires
~
2.5
GiB
free
space
#
in
/
tmp
so
if
we
ever
need
to
include
this
class
on
a
system
#
that
has
a
smaller
tmpfs
mounted
there
,
we
'll need to make
# this configurable.
environment => [ '
TMPDIR
=/
tmp
'
],
tails::check_mirrors::cronjob { '
Full
run
':
args => ['
--ignore-failures', 'failures.json'],
hour
=>
0
,
minute
=>
16
,
}
tails
::
check_mirrors
::
cronjob
{ 'Fast run #1: optimized for European morning':
args => ['--fast', '--store-failures', 'failures.json'],
hour => 4,
minute => 16,
}
tails
::
check_mirrors
::
cronjob
{ 'Fast run #2: optimized for American morning':
args => ['--fast', '--store-failures', 'failures.json'],
hour => 12,
minute => 16,
}
tails
::
check_mirrors
::
cronjob
{ 'Fast run #3: to complete the 3 × 8 shifts':
args => ['--fast', '--store-failures', 'failures.json'],
hour => 20,
minute => 16,
}
}
manifests/check_mirrors/cronjob.pp
0 → 100644
View file @
9af5f53a
# Manage a cronjob that runs check-mirrors.rb
define
tails::check_mirrors::cronjob
(
Integer
[
0
,
23
]
$hour
,
Integer
[
0
,
59
]
$minute
,
Array
[
String
]
$args
=
[],
)
{
assert_private
()
$args_str
=
join
(
$args
,
' '
)
cron
{
"tails_check_mirrors
${title}
"
:
command
=>
"sleep
\$
((
\$
( </dev/urandom od -N2 -t u2 -A none ) >> 5 )) && flock --nonblock check-mirrors.lock
\"
${tails::check_mirrors::repo_checkout}
/check-mirrors.rb
\"
${args_str}
"
,
# lint:ignore:140chars -- command
user
=>
$tails::check_mirrors::user
,
hour
=>
$hour
,
minute
=>
$minute
,
require
=>
[
Vcsrepo
[
$tails::check_mirrors::repo_checkout
],
Package
[
$tails::check_mirrors::needed_packages
],
Postfix
::
Mailalias
[
$tails::check_mirrors::user
],
Exec
[
'Import Tails signing key'
],
],
# By default, check-mirrors.rb would create its per-run temporary
# directory in $CWD, i.e. in this context $HOME, which is never
# cleaned up automatically; so interrupted runs would leave
# temporary files behind them forever. Let's ask check-mirrors.rb
# to instead create its per-run temporary directory in a place
# that is cleaned up on boot. This requires ~2.5 GiB free space
# in /tmp so if we ever need to include this class on a system
# that has a smaller tmpfs mounted there, we'll need to make
# this configurable.
environment
=>
[
'TMPDIR=/tmp'
],
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment