Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
how to create a node object from a parameterised class?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  3 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Nikolay Sturm  
View profile  
 More options Feb 18 2011, 12:34 pm
From: Nikolay Sturm <goo...@erisiandiscord.de>
Date: Fri, 18 Feb 2011 18:34:54 +0100
Local: Fri, Feb 18 2011 12:34 pm
Subject: how to create a node object from a parameterised class?
Hi,

in order to extend cucumber-puppet to support parameterised classes, I
need to create a node object from a parameterised class.

At the moment my code does sth like this:

node = Puppet::Node.new(@facts['hostname'], :classes => @klass)
node.merge(@facts)
@catalog = Puppet::Resource::Catalog.find(node.name, :use_node => node)

Where and how would I have to add the class's parameters?

cheers,

Nikolay

--
"It's all part of my Can't-Do approach to life." Wally


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dan Bode  
View profile  
 More options Feb 19 2011, 1:26 am
From: Dan Bode <d...@puppetlabs.com>
Date: Fri, 18 Feb 2011 22:26:01 -0800
Local: Sat, Feb 19 2011 1:26 am
Subject: Re: [Puppet-dev] how to create a node object from a parameterised class?

Hi Nikolay,

On Fri, Feb 18, 2011 at 9:34 AM, Nikolay Sturm <goo...@erisiandiscord.de>wrote:

> Hi,

> in order to extend cucumber-puppet to support parameterised classes, I
> need to create a node object from a parameterised class.

> At the moment my code does sth like this:

> node = Puppet::Node.new(@facts['hostname'], :classes => @klass)
> node.merge(@facts)
> @catalog = Puppet::Resource::Catalog.find(node.name, :use_node => node)

This is fixed by my patch for param class support for ENC:

http://projects.puppetlabs.com/issues/5045

This will only work against 2.6.5 (currently at rc4)

The only difference is that :classes should take a hash instead of an array.

require 'puppet'
=> true
irb(main):002:0> node = Puppet::Node.new('nodename', :classes => {'ntp' =>
{'servers' => ['foo'] }})
=> #<Puppet::Node:0xb7841838 @parameters={}, @time=Sun Feb 13 11:49:25 -0600
2011, @name="nodename", @classes={"ntp"=>{"servers"=>["foo"]}}>
irb(main):003:0> node.merge({})
=> "production"
irb(main):004:0> Puppet::Resource::Catalog.find(node.name, :use_node =>
node)


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Nikolay Sturm  
View profile  
 More options Mar 6 2011, 1:38 pm
From: Nikolay Sturm <goo...@erisiandiscord.de>
Date: Sun, 6 Mar 2011 19:38:39 +0100
Local: Sun, Mar 6 2011 1:38 pm
Subject: Re: [Puppet-dev] how to create a node object from a parameterised class?
* Dan Bode [2011-02-19]:

> This is fixed by my patch for param class support for ENC:

> http://projects.puppetlabs.com/issues/5045
> This will only work against 2.6.5 (currently at rc4)

> The only difference is that :classes should take a hash instead of an array.

Great, works fine. Thanks for your help!

cheers,

Nikolay


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »