Add multinode_db class
This commit is contained in:
parent
dec2ebd0e7
commit
b62746ac66
1 changed files with 17 additions and 0 deletions
17
manifests/multinode_db.pp
Normal file
17
manifests/multinode_db.pp
Normal file
|
@ -0,0 +1,17 @@
|
|||
class sunetdrive::multinode_db(){
|
||||
$is_multinode = true;
|
||||
$environment = sunetdrive::get_environment()
|
||||
$allcustomers = hiera_hash('multinode_mapping')
|
||||
$customers = $allcustomers.keys
|
||||
|
||||
$customers.each | $customer | do {
|
||||
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',
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue