Add scan cronjob to test
This commit is contained in:
parent
a4a9e492f5
commit
fc0a790bd1
2 changed files with 26 additions and 0 deletions
|
@ -97,6 +97,22 @@ define sunetdrive::app_type (
|
||||||
content => template('sunetdrive/application/get_containers'),
|
content => template('sunetdrive/application/get_containers'),
|
||||||
mode => '0744',
|
mode => '0744',
|
||||||
}
|
}
|
||||||
|
if ($environment == 'test') {
|
||||||
|
file { '/usr/local/bin/scan_external_mounts':
|
||||||
|
ensure => present,
|
||||||
|
force => true,
|
||||||
|
owner => 'root',
|
||||||
|
group => 'root',
|
||||||
|
content => template('sunetdrive/application/scan_external_mounts.sh'),
|
||||||
|
mode => '0744',
|
||||||
|
}
|
||||||
|
cron { 'scan_external_mounts':
|
||||||
|
command => '/usr/local/bin/scan_external_mounts',
|
||||||
|
user => 'root',
|
||||||
|
minute => '42',
|
||||||
|
hour => '9',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
unless $is_multinode{
|
unless $is_multinode{
|
||||||
user { 'www-data': ensure => present, system => true }
|
user { 'www-data': ensure => present, system => true }
|
||||||
|
|
10
templates/application/scan_external_mounts.sh
Normal file
10
templates/application/scan_external_mounts.sh
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Only run if this is the only instance of this script running
|
||||||
|
if [[ $(pgrep -f "${0}" | wc -l) -eq 1 ]]; then
|
||||||
|
for container in $(get_containers); do
|
||||||
|
for id in $(nocc "${container}" files_external:list --all --output json | jq '.[].mount_id' | jq .); do
|
||||||
|
nocc "${container}" files_external:scan "${id}"
|
||||||
|
done
|
||||||
|
done
|
||||||
|
fi
|
Loading…
Add table
Reference in a new issue