Issue #4715 has been updated by James Turnbull.

Status changed from Unreviewed to Rejected

Rather than create a whole other define - why not pass a variable to the 
definition for the source of the file?  
----------------------------------------
Feature #4715: Extending defines
http://projects.puppetlabs.com/issues/4715

Author: Nico Schottelius
Status: Rejected
Priority: Normal
Assignee: 
Category: 
Target version: 
Affected version: 
Keywords: 
Branch: 


Hey devs,

I have a define like this:

<pre>
define rvm::install() {

   $rvminstaller = "/home/$name/rvminstall"

   file { $rvminstaller:
      ensure => present,
      mode => 755,
      source => "puppet:///rvm/rvminstall",
   }   

   exec { $rvminstaller:
      cwd => "/home/$name",
      creates => "/home/$name/.rvm",
      user => $name,
   }   
}
</pre>

Now I would like to write another define, that does almost exactly the same, 
but chooses a different source for the file.
Currently I would need to copy and paste the define and change the source.

If I could inherit the define, this would be way easier:

<pre>
define myrvm::install() inherits rvm::install
{
   File[$rvminstaller] {
      source => "puppet:///myrvm/rvminstall",
   }
}
</pre>

Would be handy to see this or another easy variant with code reuse in a future 
version.

Cheers,

Nico



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