1 # Allow a user to access the database for the service
4 # String with the form dbname_host. The host part of the string is the host
18 # the privileges to grant to this user
20 define openstacklib::db::mysql::host_access (
26 validate_re($title, '_', 'Title must be $dbname_$host')
28 $host = inline_template('<%= @title.split("_").last %>')
30 mysql_user { "${user}@${host}":
31 password_hash => $password_hash,
32 require => Mysql_database[$database],
35 mysql_grant { "${user}@${host}/${database}.*":
36 privileges => $privileges,
37 table => "${database}.*",
38 require => Mysql_user["${user}@${host}"],
39 user => "${user}@${host}",