Issue #11543 has been reported by Josh Cooper.

----------------------------------------
Bug #11543: puppetlabs-mysql module does not allow the same user to be 
associated with multiple databases
https://projects.puppetlabs.com/issues/11543

Author: Josh Cooper
Status: Accepted
Priority: Normal
Assignee: Carl Caum
Category: modules
Target version: 
Affected Puppet version: 
Keywords: mysql
Branch: 


Given:

<pre>
mysql::db { 'dashboard_development':
  user     => 'dashboard',
  password => 'password',
  host     => 'localhost',
  grant    => ['all'],
}

mysql::db { 'dashboard_test':   
  user     => 'dashboard',
  password => 'password',
  host     => 'localhost',
  grant    => ['all'],
}
</pre>

produces:

<pre>

$ puppet apply --modulepath ~/work/modules/ db2.pp  --verbose
Duplicate definition: Database_user[dashboard@localhost] is already defined 
in file /home/josh/work/modules/mysql/manifests/db.pp at line 60; 
cannot redefine at /home/josh/work/modules/mysql/manifests/db.pp:60 on node 
ubuntu.localdomain
josh@ubuntu:~$ puppet apply --modulepath ~/work/modules/ db2.pp  --verbose 
--trace
/home/josh/work/puppet/lib/puppet/resource/catalog.rb:584:in 
`fail_on_duplicate_type_and_title'
/home/josh/work/puppet/lib/puppet/resource/catalog.rb:73:in `add_resource'
/home/josh/work/puppet/lib/puppet/parser/compiler.rb:58:in `add_resource'
/home/josh/work/puppet/lib/puppet/parser/ast/resource.rb:59:in `evaluate'
/home/josh/work/puppet/lib/puppet/util/errors.rb:35:in `exceptwrap'
/home/josh/work/puppet/lib/puppet/parser/ast/resource.rb:43:in `evaluate'
/home/josh/work/puppet/lib/puppet/parser/ast/resource.rb:42:in `collect'
/home/josh/work/puppet/lib/puppet/parser/ast/resource.rb:42:in `evaluate'
/home/josh/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in
 `collect'
/home/josh/work/puppet/lib/puppet/parser/ast/branch.rb:16:in `each'
/home/josh/work/puppet/lib/puppet/parser/ast/branch.rb:15:in `each'
</pre>

The defined type is trying to declare the 'dashboard' user twice, and obviously 
that isn't allowed. I tried using `if !defined("...")` to conditionally add the 
user in the defined type definition `manifests/db.pp`, but that did not work 
for me.


-- 
You have received this notification because you have either subscribed to it, 
or are involved in it.
To change your notification preferences, please click here: 
http://projects.puppetlabs.com/my/account

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/puppet-bugs?hl=en.

Reply via email to