On 3/16/2010 at 10:45 AM, "Robinson, Eric" <[email protected]> wrote: 
> The only way I can find to add new group members via a script is to edit 
> cib.xml. 
>  
> I find the following section... 
>  
>         <primitive class="lsb" id="MySQL_001" type="mysql_001"/> 
>         <primitive class="lsb" id="MySQL_002" type="mysql_002"/> 
>         <primitive class="lsb" id="MySQL_003" type="mysql_003"/> 
>  
> Using a shell script, it would be easy to add a new line to the bottom 
> of that section... 
>  
>         <primitive class="lsb" id="MySQL_004" type="mysql_004"/>  
>  
> Does using a script to edit cib.xml violate the CIB rules? I know I'm 
> not supposed to directly edit the file. I assume that is because of the 
> high likelihood of humar error. Is there any problem with editing it via 
> a script? 

You can't edit the file directly, even with a script, but you can script
cibadmin to replace pieces of XML in the CIB for you.  For example, to
manually edit a group's XML, try:

  # cibadmin --query --xpath "//gro...@id='WHATEVER']" > group.xml
  # vim group.xml
     (add whatever primitives...)
  # cibadmin --replace --xml-file group.xml

You can use pipes and things instead of writing to temporary files
and manually running vim, of course.  See "cibadmin --help" for more
options.

HTH,

Tim


-- 
Tim Serong <[email protected]>
Senior Clustering Engineer, OPS Engineering, Novell Inc.



_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems

Reply via email to