[Puppet Users] Re: Composite namevars for custom Type
John, Thanks for the link. What I think is happening, is that I am not overloading the title_patterns function/method correctly. I've followed some other examples I came across, including the one in the link. But it does not seem to be picking up the def self.title_patterns from the custom type. And I'm still learning ruby and the inner workings of puppet. Len On Saturday, January 25, 2014 12:08:18 PM UTC-5, Len wrote: > > > Jan 23 > To all, > > I am on puppet 2.7.3 and I'm working on a custom RabbitMQ type, that will > use composite namevar. I did not see any work out there already for > managing rabbitMQ bindings so I've started on one and I'm running into > problems with the composite namevar. I have a very basic type ( below ) but > when I run the puppet as an agent I still get the error "Error 400 on > SERVER: Could not render to pson: you must specify title patterns when > there are two or more key attributes" > > Any help or pointers would be appreciated. > > #Puppet Manifest: > > rabbitmq_binding { 'testing': > > source => "src", > > destination => "dest", > > } > > # Puppet Type > > Puppet::Type.newtype(:rabbitmq_binding) do > > desc 'rabbitmq_binding creates a puppet type for managing rabbitMQ > binding' > > def self.title_patterns > > [ [ > > /^(.*):(.*)$/, # pattern to parse : > > [ > > [:source, lambda{|x| x} ], > > [:destination, lambda{|x| x} ] > > ] ] > > ] > > end > > newparam( :source ) do > > isnamevar > > end > > newparam( :destination ) do > > isnamevar > > end > > end > -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/d5bdb354-96f5-46a3-80df-f10075b579dd%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.
Re: [Puppet Users] Composite namevars for custom Type
On 01/25/2014 06:08 PM, Len wrote: Jan 23 To all, I am on puppet 2.7.3 and I'm working on a custom RabbitMQ type, that will use composite namevar. I did not see any work out there already for managing rabbitMQ bindings so I've started on one and I'm running into problems with the composite namevar. I have a very basic type ( below ) but when I run the puppet as an agent I still get the error "Error 400 on SERVER: Could not render to pson: you must specify title patterns when there are two or more key attributes" Any help or pointers would be appreciated. #Puppet Manifest: rabbitmq_binding { 'testing': source => "src", destination => "dest", } # Puppet Type Puppet::Type.newtype(:rabbitmq_binding) do desc 'rabbitmq_binding creates a puppet type for managing rabbitMQ binding' def self.title_patterns [ [ /^(.*):(.*)$/, # pattern to parse : [ [:source, lambda{|x| x} ], [:destination, lambda{|x| x} ] ] ] ] end newparam( :source ) do isnamevar end newparam( :destination ) do isnamevar end end -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9fba29f5-30ef-4a93-8ede-e9a5e18488af%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out. I dont have an answer, but stumbled over this post. https://groups.google.com/forum/#!topic/puppet-dev/CVYwvHnPSMc Hope it helps -- Johan De Wit Open Source Consultant Red Hat Certified Engineer (805008667232363) Puppet Certified Professional 2013 (PCP006) _ Open-Future Phone +32 (0)2/255 70 70 Zavelstraat 72 Fax +32 (0)2/255 70 71 3071 KORTENBERG Mobile+32 (0)474/42 40 73 BELGIUM http://www.open-future.be _ Next Events: Puppet Fundamentals Training | http://www.open-future.be/puppet-fundamentals-training-4-till-6th-february Puppet Intruction Course | http://www.open-future.be/puppet-introduction-course-7th-february Zabbix Certified Training | http://www.open-future.be/zabbix-certified-training-10-till-12th-february Zabbix for Large Environments Training | http://www.open-future.be/zabbix-large-environments-training-13-till-14th-february Subscribe to our newsletter | http://eepurl.com/BUG8H -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/52E40966.9020402%40open-future.be. For more options, visit https://groups.google.com/groups/opt_out.
[Puppet Users] Composite namevars for custom Type
Jan 23 To all, I am on puppet 2.7.3 and I'm working on a custom RabbitMQ type, that will use composite namevar. I did not see any work out there already for managing rabbitMQ bindings so I've started on one and I'm running into problems with the composite namevar. I have a very basic type ( below ) but when I run the puppet as an agent I still get the error "Error 400 on SERVER: Could not render to pson: you must specify title patterns when there are two or more key attributes" Any help or pointers would be appreciated. #Puppet Manifest: rabbitmq_binding { 'testing': source => "src", destination => "dest", } # Puppet Type Puppet::Type.newtype(:rabbitmq_binding) do desc 'rabbitmq_binding creates a puppet type for managing rabbitMQ binding' def self.title_patterns [ [ /^(.*):(.*)$/, # pattern to parse : [ [:source, lambda{|x| x} ], [:destination, lambda{|x| x} ] ] ] ] end newparam( :source ) do isnamevar end newparam( :destination ) do isnamevar end end -- You received this message because you are subscribed to the Google Groups "Puppet Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/9fba29f5-30ef-4a93-8ede-e9a5e18488af%40googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.