Skip to content
GitLab
Menu
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
7370670c
Commit
7370670c
authored
Jul 03, 2020
by
intrigeri
Browse files
Merge remote-tracking branch 'origin/feature/17755-multiple-runs'
Closes
tails/tails#17755
,
tails/puppet-tails!7
parents
bb7742eb
9dbdc6f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
manifests/check_mirrors.pp
View file @
7370670c
...
...
@@ -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 @
7370670c
# 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
.
Attach a 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