Andrea Righi wrote:
[snip]
> 
> To summarize, we have 2 different approaches:
> 
> 1) the "diff" approach: the most local scripts must be written "on top" of the
> effects made by the most global scripts (problem: irreversible effects)
> 
> 2) the "alternatives" approach: the most local scripts are mutually exclusive
> with the most gloabal scripts (more exactly a local script excludes a more
> global script that has the same number)
> 
> I think that both of them are valid. But I've to say that I prefer the 1st 
> approach.
> 
> One advantage of 1) is that if you need to execute the same script in all the
> nodes it's enough to define the script as "all" (simple). In the 2nd approach
> there could be a "group" or "hostname" script that excludes the more global
> script (maybe even erroneously); in this case you could replicate the same
> operations from the global script into the local script, but in this way 
> you've
> to *remember* that, and it is surely more difficult to maintain and to apply
> future changes...
> 
> Moreover, I like 1) because it uses the same concept of SystemImager overrides
> (/var/lib/systemimager/overrides/README), that means no mutual exclusion and
> files are distributed in the order: global, group, hostname. This has proven 
> to
> be a nice approach, mainly because you don't have to replicate the same files 
> in
> multiple overrides, and this helps a lot from the maintenance point of view 
> and
> it's less error prone.
> 
> OTOH the big disadvantage of the 1st approach is that it's not possible to
> handle irreversible scripts and exclusions.

BTW... if the main problem is the mutual exclusion, what do you think to encode
this "property" into the script name? For example, suppose to have 3 scripts:

30all.networking
10Compute.networking
20node001.networking

Where node001 belongs to Compute and (obviously) Compute belongs to all.

The default behaviour is to execute all the 3 scripts in the following order:

1) 30all.networking
2) 10Compute.networking
3) 20node001.networking

Suppose that you want that 20node001.networking excludes the others. You can
declare the scripts as following:

30all.networking
10Compute.networking
20node001.networking._MUTEX_ (or a similar suffix)

In this way if there are multiple scripts with the same name "networking", that
should be executed in node001, they will be dropped and only
20node001.networking._MUTEX will be executed.

Otherwise if you have the _MUTEX_ prefix in the group script:

30all.networking
10Compute.networking._MUTEX_
20node001.networking

The scripts executed in node001 will be (in order):

1) 10Compute.networking._MUTEX_
2) 20node001.networking

The _MUTEX_ prefix is ignored for the scripts that belongs to the "all" class.

-Andrea

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
sisuite-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sisuite-devel

Reply via email to