[Puppet Users] Re: migrating from cfengine to puppet, node wrangling question

2013-02-20 Thread Paul Tötterman
Hi Michael 

This works, but I'm not sure it's the best way about going about it. I'm 
 trying to define host groups in my site.pp file in such a way that when 
 puppet runs on my nodes, they know their functional role and are 
 configured accordingly.


May I suggest that you look into using a node classifier (ENC) or at least 
hiera to separate data from code?

I have a module called 'role' with classes like 'workstation' and 'compute' 
which include other classes. Then I can just assign the class 
role::workstation or role::compute to a node.

Cheers,
Paul 

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.




Re: [Puppet Users] Re: migrating from cfengine to puppet, node wrangling question

2013-02-20 Thread jcbollinger


On Wednesday, February 20, 2013 6:17:29 AM UTC-6, Felix.Frank wrote:

 On 02/20/2013 09:36 AM, Paul T�tterman wrote: 
  This works, but I'm not sure it's the best way about going about it. 
  I'm trying to define host groups in my site.pp file in such a way 
  that when puppet runs on my nodes, they know their functional role 
  and are configured accordingly. 
  
  
  May I suggest that you look into using a node classifier (ENC) or at 
  least hiera to separate data from code? 

 More to the point: The funcionality underneath your current pattern 
 (i.e. dynamic variable scoping) is deprecated in puppet 2.7 and (as I 
 understand) is going away in puppet 3. 



Dynamic variable scoping is indeed gone in Puppet 3, except (as I 
understand it) for node-scoped variables.  That exception was not 
originally planned, but but the removal of dynamic scoping proved too big a 
change otherwise.  It would have been different, perhaps, if node-scoped 
variables had qualified names, but they don't.

That doesn't make reliance on node variables a particularly good idea, 
however.  Externalizing the data is a better solution to the problem, and 
Hiera is my recommendation for accessing such external data.  An ENC is 
another viable option, but even you're already using one I'd advise you to 
consider Hiera for this particular task.

John

-- 
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 post to this group, send email to puppet-users@googlegroups.com.
Visit this group at http://groups.google.com/group/puppet-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.