Puppet Class: isp3node::mariadb::connect_master
- Defined in:
- manifests/mariadb/connect_master.pp
Summary
Connects instances to the ISPConfig Master DatabaseOverview
If this instance is a slave node, this class exports a mariadb user to be created on the master and be used during ISPConfig install and update
If it is the master, it realizes all exported users for creation
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'manifests/mariadb/connect_master.pp', line 16
class isp3node::mariadb::connect_master(
String $user,
String $password,
) {
unless($facts['fqdn'] == lookup('isp3node::master')) {
# Export Users to be created on the master node
$users = [
"${user}@${facts['fqdn']}",
"${user}@${facts['networking']['ip']}",
"${user}@${facts['networking']['ip6']}",
]
@@mysql_user{$users:
ensure => present,
tag => ['isp3node-slave', 'isproot-on-master'],
password_hash => mysql::password($password),
}
$users.each |$u| {
@@mysql_grant{ "${u}/dbispconfig":
ensure => present,
tag => ['isp3node-slave', 'isproot-on-master'],
user => $u,
require => Mysql_user[$u],
}
}
}
else {
# Realize the exported users and grants
Mysql_user <<| tag == 'isp3node-slave' and tag == 'isproot-on-master' |>>{
max_user_connections => 0,
max_connections_per_hour => 0,
max_updates_per_hour => 0,
max_queries_per_hour => 0
}
Mysql_grant <<| tag == 'isp3node-slave' and tag == 'isproot-on-master' |>>{
table => 'dbispconfig',
privileges => ['ALL'],
options => ['GRANT']
}
}
}
|