Issue #4314 has been updated by Jasper Poppe.

I can confirm this, I vote for allowing '-' in definitions (It worked before, 
so compatibility wise it would be nice) or at least send a clear error message.

This:

class get-puppet {

        define wget ($source, $destination) {

                exec { $name:
                        command => "/usr/bin/wget $source -O /tmp/$destination",
                        creates => "/tmp/$destination";
                }
        }

}

get-puppet::wget {
        'wget-puppet':
                source      => 
'http://mp-puppetmaster002.intern.kijiji.net/puppetdebs/puppet_0.25.4-3_all.deb',
                destination => 'puppet_0.25.4-3_all.deb';
        'wget-puppet-common':
                source      => 
'http://mp-puppetmaster002.intern.kijiji.net/puppetdebs/puppet-common_0.25.4-3_all.deb',
                destination => 'puppet-common_0.25.4-3_all.deb';
        'wget-facter':
                source      => 
'http://mp-puppetmaster002.intern.kijiji.net/puppetdebs/facter_1.5.7-1_all.deb',
                destination => 'facter_1.5.7-1_all.deb';
}

exec { "install-puppet":
                logoutput   => on_failure,
                path        => '/bin:/usr/bin:/usr/sbin:/sbin',
                command     => '/usr/bin/dpkg -i /tmp/puppet_0.25.4-3_all.deb 
/tmp/puppet-common_0.25.4-3_all.deb /tmp/facter_1.5.7-1_all.deb && rm 
/tmp/*.deb',
                require     => [ Exec['wget-puppet'], 
Exec['wget-puppet-common'] ];
}

Gnerates:
cs-ops001b:/seedpimp# puppet get-puppet26.pp
Duplicate definition: Get-puppet::Wget[wget-puppetcommon] is already defined in 
file /seedpimp/get-puppet26.pp at line 23; cannot redefine at 
/seedpimp/get-puppet26.pp:23 on node cs-ops001b.intern.marktplaats.nl
cs-ops001b:/seedpimp#

With older versions it works fine.
----------------------------------------
Bug #4314: Dashes in definition names no longer allowed?
http://projects.puppetlabs.com/issues/4314

Author: Thorsten Biel
Status: Accepted
Priority: Normal
Assigned to: 
Category: 
Target version: 2.6.1
Affected version: 2.6.0
Keywords: 
Branch: 


Following output from a client running Puppet 0.25.5, connecting to a master 
running 2.6.0:

<pre>
 # puppetd --test
err: Could not retrieve catalog from remote server: Error 400 on SERVER: 
Duplicate definition: Apache::Apache-webmon[default] is already defined in file 
/etc/puppet/modules/apache/manifests/setup_apache2_instance.pp at line 361; 
cannot redefine at 
/etc/puppet/modules/apache/manifests/setup_apache2_instance.pp:368 on node 
usateppndb01
warning: Not using cache on failed catalog
err: Could not retrieve catalog; skipping run
</pre>

The corresponding excerpt from the manifest:

<pre>
   # set up monitoring using munin and webmon
   #
   # TODO: Munin can handle multiple Apaches per plugin, so this should
   # be re-worked to set up Munin once for all Apache instances on
   # a server
   #
   apache::apache-munin { "${apache2instancename}":
     apache2instancename => "${apache2instancename}",
     projectname => "${projectname}"
   }
   # webmon should be cleanly set up with separate configs and cron
   # jobs per instance - easier to clean up afterwards
   #
   apache::apache-webmon { "${apache2instancename}":
     apache2instancename => "${apache2instancename}",
     projectname => "${projectname}"
   }
</pre>

When I change the definition names to remove the dash (i.e. 
apache::apache-munin becomes apache::munin, same with apache::apache-webmon) 
the error disappears.

The above definitions used to work on a 0.25.4 master. I can't find any mention 
of
syntax changes regarding definitions in the release notes, please advise.





-- 
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