sunetdrive/manifests/multinode_db.pp

18 lines
756 B
ObjectPascal
Raw Permalink Normal View History

2023-02-27 09:14:26 +00:00
class sunetdrive::multinode_db(){
$is_multinode = true;
$environment = sunetdrive::get_environment()
$allcustomers = hiera_hash('multinode_mapping')
$customers = $allcustomers.keys
2023-02-27 09:19:34 +00:00
$customers.each |$customer| {
2023-02-27 09:14:26 +00:00
file { "/etc/mariadb/backups/${customer}":
ensure => directory,
}
file { "/etc/mariadb/init/04-nextcloud.${customer}.sql":
ensure => present,
content => "CREATE SCHEMA nextcloud_${customer};\nCREATE USER 'nextcloud_${customer}'@'%' IDENTIFIED BY '${hiera("${customer}_mysql_user_password")}';\nGRANT ALL PRIVILEGES ON nextcloud_${customer}.* TO 'nextcloud_${customer}'@'%' IDENTIFIED BY '${hiera("${customer}_mysql_user_password")}';\n",
mode => '0744',
}
}
}