multinode-db1 test: Add rclone and statistics remote

This commit is contained in:
Magnus Andersson 2024-08-29 11:02:30 +02:00 committed by Micke Nordin
parent 90372ddd01
commit 57b2ca6316
Signed by untrusted user: Micke
GPG key ID: 0DA0A7A5708FE257

View file

@ -15,12 +15,8 @@ class sunetdrive::multinode_db(){
}
}
if $facts["networking"]["fqdn"] =~ /^multinode-db1\.drive\.(test\.){1}sunet\.se$/ {
$statistics_secret = safe_hiera('statistics_secret')
notify { 'hostmessage':
message => 'We are on multinode-db1. Set up statistics environment.',
}
$custdata=$customers.reduce({}) |$memo, $value| {
$memo + {$value => lookup($value)}
message => "We are on multinode-db1. Set up statistics environment.",
}
$rclone_url = 'https://downloads.rclone.org/rclone-current-linux-amd64.deb'
$local_path = '/tmp/rclone-current-linux-amd64.deb'
@ -41,33 +37,5 @@ class sunetdrive::multinode_db(){
group => 'root',
mode => '0600',
}
file { '/root/tasks/listusersbydep.sh':
ensure => file,
content => template('sunetdrive/mariadb/listusersdep.sh.erb'),
owner => 'root',
group => 'root',
mode => '0700',
}
file { '/root/tasks/genusersondepartmentlists.sh':
ensure => file,
content => template('sunetdrive/mariadb/genuserdeplists.sh.erb'),
owner => 'root',
group => 'root',
mode => '0700',
}
file {'/opt/mariadb/statistics/custdata.json':
ensure => file,
content => template('sunetdrive/mariadb/custconfig.json.erb'),
owner => 'root',
group => 'root',
mode => '0600',
}
sunet::scriptherder::cronjob { 'genuserdeplists':
cmd => '/root/tasks/genusersondepartmentlists.sh',
hour => '2',
minute => '5',
ok_criteria => ['exit_status=0','max_age=30h'],
warn_criteria => ['exit_status=1', 'max_age=60h'],
}
}
}