On Tuesday, February 4, 2014 2:03:12 AM UTC-6, Krist van Besien wrote:
>
>
>
> On Wednesday, January 29, 2014 3:41:43 PM UTC+1, jcbollinger wrote:
>>
>>
>> I'm uncertain what you mean.  If "doing this" refers to enumerating the 
>> cluster members in advance, then that can only be something that you, as 
>> cluster planner, do yourself, outside the scope of Puppet (c.f. "in 
>> advance").
>>
>> If you're asking how to communicate that data to Puppet, then whatever 
>> data service is available is probably fine.  Hiera would be great for 
>> this.  With an ENC such as Foreman, you can have the ENC pass the member 
>> list to Puppet as a top-scope variable or as a parameter of one or more 
>> classes.  In that case, you may need to create a wrapper class around 
>> whatever third-party module you want to use; its role would be to pass on 
>> the ENC-provided data as module class parameters.
>>
>> If "doing this" is supposed to mean something more general, along the 
>> lines of "using Puppet to arrange my nodes into a cluster," then how best 
>> to approach that depends on a great many factors.  We have already touched 
>> on some of those: what clustering software you want to use (if any), and 
>> the extent to which cluster membership can or must be dynamic.  We can 
>> probably help you with devising manifests that will accomplish your 
>> objectives, but to do so we need more information.
>>
>>
> To give you an idea. I defined the wollowing class:
>
> class sws::services::cluster (
>
>   $control_clu_name        = $sws::params::control_clu_name,
>   $control_clu_members     = $sws::params::control_clu_members,
>
> ) inherits sws::params {
>
>     package { 'ccs' :
>       ensure => installed,
>     }
>
>     class {'pacemaker::corosync':
>       cluster_name    => $control_clu_name,
>       cluster_members => $control_clu_members,
>       require         => Package['ccs']
>     }
>
> }
>
> (There's a lot more in there, but I cut out the not so relevant bits...)
>
> Currently this works, if I just declare the control_clu_name and 
> control_clu_members parameters in advance, and then add this class to the 
> nodes I listed in control_clu_members via Foreman.
>
> Now when I add another node to the cluster I need to do two things: Add 
> the class to the node in Foreman, and add it's fqdn to the 
> control_clu_members parameter. I was just wondering if there was a way to 
> do this last thing automatically.
>
>

Although I don't doubt that your class is applied successfully when used as 
you describe, I am less confident that it produces the results you expect.  
Specifically, I recommend you confirm that when adding a node to an 
existing, running cluster, your approach causes the other nodes to be 
updated to know about the new one.  The module appeared geared to not do 
that, but I didn't analyze it deeply enough to be certain.

As Henrik suggested, it is possible for the catalog compiler to query 
puppetdb to glean information about nodes that have already been 
configured.  If in fact I am mistaken about pre-existing nodes not being 
updated, then an approach based on such queries could do what you want.  If 
I am *not* mistaken about that, however, then your approach is 
irretrievably broken -- in that case, with the module you are currently 
using, you would need to tell Foreman what all the cluster nodes are going 
to be before you configure the first one.


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 view this discussion on the web visit 
https://groups.google.com/d/msgid/puppet-users/a008eef1-e285-43ab-af46-d2b959fa788e%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to