Ben Lavender
2011-Jan-10 20:27 UTC
[Puppet Users] Problem with multiple requires in Ruby DSL
I''m loving playing around with the DSL. There are some problems (ie 5237), but now that it''s Ruby, I can fix them! woo! However, I''m stumped on this one, which may or may not be related to the DSL. When trying to have a resource have a simple dependency on two things at once, it simply fails, and I''m stumped as to why. The error message is: Parameter require failed: No title provided and "[ Exec[git-/usr/local/ resque-runner], Rvm_install[1.9.2-p136]]" is not a valid resource reference My definition looks like this: define :bundle_install, :rvm do rvm_exec "bundle-#{@name}", :command => "bundle install --without production", :ruby => @rvm, :path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin", # this alone works: #:require => "Rvm_install[#{@rvm}]", # this alone also works: #:require => "Exec[git-#{@name}]", # this fails: :require => "[ Exec[git-#{@name}], Rvm_install[#{@rvm}]]", :cwd => @name, :creates => "#{@name}/.bundle/config" end Am I missing something, or should I open a ticket? Thanks, Ben -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Stefan Schulte
2011-Jan-10 20:58 UTC
Re: [Puppet Users] Problem with multiple requires in Ruby DSL
On Mon, Jan 10, 2011 at 12:27:13PM -0800, Ben Lavender wrote:> I''m loving playing around with the DSL. There are some problems (ie > 5237), but now that it''s Ruby, I can fix them! woo! > > However, I''m stumped on this one, which may or may not be related to > the DSL. When trying to have a resource have a simple dependency on > two things at once, it simply fails, and I''m stumped as to why. The > error message is: > > Parameter require failed: No title provided and "[ Exec[git-/usr/local/ > resque-runner], Rvm_install[1.9.2-p136]]" is not a valid resource > reference > > My definition looks like this: > > define :bundle_install, :rvm do > rvm_exec "bundle-#{@name}", > :command => "bundle install --without production", > :ruby => @rvm, > :path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin", > > # this alone works: > #:require => "Rvm_install[#{@rvm}]", > > # this alone also works: > #:require => "Exec[git-#{@name}]", > > # this fails: > :require => "[ Exec[git-#{@name}], Rvm_install[#{@rvm}]]", > > :cwd => @name, > :creates => "#{@name}/.bundle/config" > end > > Am I missing something, or should I open a ticket? >Never tried the dsl but I guess require wants an array, not a string that looks like an array. So I think :require => [ "Exec[git-#{@name}]", "Rvm_install[#{@rvm}]"] will work. -Stefan
Ben Lavender
2011-Jan-10 21:37 UTC
[Puppet Users] Re: Problem with multiple requires in Ruby DSL
Yep, that did the trick. Seems I extrapolated the ''string that looks like puppet'' one step too far. I added an example to the wiki. Thanks, Ben On Jan 10, 2:58 pm, Stefan Schulte <stefan.schu...@taunusstein.net> wrote:> On Mon, Jan 10, 2011 at 12:27:13PM -0800, Ben Lavender wrote: > > I''m loving playing around with the DSL. There are some problems (ie > > 5237), but now that it''s Ruby, I can fix them! woo! > > > However, I''m stumped on this one, which may or may not be related to > > the DSL. When trying to have a resource have a simple dependency on > > two things at once, it simply fails, and I''m stumped as to why. The > > error message is: > > > Parameter require failed: No title provided and "[ Exec[git-/usr/local/ > > resque-runner], Rvm_install[1.9.2-p136]]" is not a valid resource > > reference > > > My definition looks like this: > > > define :bundle_install, :rvm do > > rvm_exec "bundle-#{@name}", > > :command => "bundle install --without production", > > :ruby => @rvm, > > :path => "/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin", > > > # this alone works: > > #:require => "Rvm_install[#{@rvm}]", > > > # this alone also works: > > #:require => "Exec[git-#{@name}]", > > > # this fails: > > :require => "[ Exec[git-#{@name}], Rvm_install[#{@rvm}]]", > > > :cwd => @name, > > :creates => "#{@name}/.bundle/config" > > end > > > Am I missing something, or should I open a ticket? > > Never tried the dsl but I guess require wants an array, not a string > that looks like an array. So I think > :require => [ "Exec[git-#{@name}]", "Rvm_install[#{@rvm}]"] > will work. > > -Stefan > > application_pgp-signature_part > < 1KViewDownload-- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com. To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en.
Seemingly Similar Threads
- Problems with SQLite3
- Does RSpec interfere with Pathname#dirname or Pathname#realpath ?
- rvm install 1.8.7 prompts "There has been an error while running make. Halting the installation."
- OS X - `require': no such file to load -- sqlite3/sqlite3_native
- Controller Testing + Devise = boom (undefined @controller, request)