module-puppetlabs-mysql/tests/mysql_db.pp
Pan 2834498e4d Allow use different name for db resource other than db name
When defining the mysql::db as exported resources, there are chances that the
same resource names are defined across the site, which will cause puppet agent
fail. By adding an optional dbname parameter, default to the $name, it allows the
resouce name to be defined differently, e.g. ${dbname}_${domain}.
Also updated test and docs for dbname parameter and add acceptance test for
dbname parameter feature
2014-03-15 13:38:13 -07:00

17 lines
391 B
Puppet

class { 'mysql::server':
config_hash => {'root_password' => 'password'}
}
mysql::db { 'mydb':
user => 'myuser',
password => 'mypass',
host => 'localhost',
grant => ['SELECT', 'UPDATE'],
}
mysql::db { "mydb_${fqdn}":
user => 'myuser',
password => 'mypass',
dbname => 'mydb',
host => ${fqdn},
grant => ['SELECT', 'UPDATE'],
tag => $domain,
}