On Thu, 2013-03-21 at 03:37 -0700, Jithin Xavier wrote: > Hello All, > > I wanted to create two two MySQL database with same user credential using > Puppet-MySQL. How can I achieve this? Please find my script below. > > class mysql::vsdatabase { > include mysql > mysql::db { 'vidispine': > user => 'user', > password => 'user123', > host => 'db.<hostname>.com', > } > } > > How can I add another database here with same credential.(If I create > different Class with different database and same credential I am getting > below error.
The current git version of the mysql module has a fix for this error: https://github.com/puppetlabs/puppetlabs-mysql/commit/1d6ca771d480e756cfdc5f84d73ef2d49f08ba38 but it has not yet been released. In the mean time, you can separately use the underlying resources: (The mysql::db type is just a convenience), just add additional 'database' and 'database_grant' resources as needed: database { 'vidispine': ensure => 'present', charset => 'utf-8', provider => 'mysql', require => Class['mysql::server'], } database_user { 'u...@example.com': ensure => 'present', password_hash => mysql_password('user123'), provider => 'mysql', require => Database['vidispine'], } database_grant { 'u...@example.com/vidispine': privileges => 'all', provider => 'mysql', require => Database_user['u...@example.com'], } -- Calvin Walton <calvin.wal...@kepstin.ca>
smime.p7s
Description: S/MIME cryptographic signature