Paul schrieb:
> Hi folks,
> 
> when I try to do something like:
> 
> define railsproject($name, $uid, $gid, $userpass, $sqlpass) {
>     mysql_database { "$name_staging": ensure => present }
>     mysql_database { "$name_production": ensure => present}
> 
>     ....more stuff...
> }
> 
> I get:
> 
> Puppet::Parser::AST::Resource failed with error ArgumentError:
> Duplicate definition: Mysql_database[] is already defined in file /etc/
> puppet//modules/../manifests/definitions/railsproject.pp at line 26;
> cannot redefine at /etc/puppet//modules/../manifests/definitions/
> railsproject.pp:27 on node dev.xxxx.net
> 
> It seems I'm missing some important detail here. Why can't types be
> used more than once? How do I create two databases?

$name_staging and $name_production are both empty, therefore 
"Mysql_database[]" (contrary to Mysql_database[something]) is defined 
twice. As Ari points out correctly, you should always use {} around 
variable names when interpolating a string:

 > define railsproject($name, $uid, $gid, $userpass, $sqlpass) {
 >     mysql_database { "${name}_staging": ensure => present }
 >     mysql_database { "${name}_production": ensure => present}
 >
 >     ....more stuff...
 > }

Regards, DavidS

-- 
dasz.at OG              Tel: +43 (0)664 2602670     Web: http://dasz.at
Klosterneuburg                                         UID: ATU64260999

        FB-Nr.: FN 309285 g          FB-Gericht: LG Korneuburg

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Puppet Users" 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-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to