The postscripts are run from a file called mypostscript which has exported
many database attributes including all of the site table.  In xCAT 2.8 we
are adding a mypostscript.tmpl,  so that  you can add any database
attributes you want to be exported for the postscripts during the install
or when you run updatenode.
You can see the design here along with other performance enhancements.
https://sourceforge.net/apps/mediawiki/xcat/index.php?title=Updatenode_Performance_Enhancements

Lissa K. Valletta
8-3/B10
Poughkeepsie, NY 12601
(tie 293) 433-3102





From:   "Pocina, Goran" <[email protected]>
To:     xCAT Users Mailing list <[email protected]>
Date:   12/11/2012 05:11 PM
Subject:        [xcat-user] xCAT db access from postscripts



See questions at end…

For RH & CentOS builds, a profile’s kickstart template goes through macro
processing
that allows it to access xCAT attribute values.

For a long time it bugged me that postscripts don’t go through the same
macro processing, until
a colleague pointed out that it should be possible for postscripts to use
curl to pull any
attributes they need during the install.   Very nice xCAT feature!!
Here’s one possible postscript that could
be called by other postscripts to load a node’s attributes into the current
shell environment:

/install/postscripts/getnodeattr:

      ATTRF=/var/log/xcat/attr.$NODE
      mkdir –p $(dirname $ATTRF)
      if [ ! -f $ATTRF ] ; then
              curl -k
      https://$MASTER/xcatws/nodes/$NODE?userName=wsuser&password=wspd  >
      $ATTRF.xml ||
                      exit 8
      fi
      # Convert
      #   <tr><td>addkcmdline</td><td>sshd</td></tr>
      # to
      #   export ATTR_addkcmdline="sshd"
      #
      sed -e '/^<[/]*table/d' \
              -e "s/<tr><td>/export ATTR_/" \
              -e 's;</td><td>;=";' \
              -e 's;</td></tr>;";' < ${ATTRF}.xml > $ATTRF
      # load into the environment
      .  $ATTRF || exit 7

To use this, one would call:          “.  /xcatpost/getnodeattr”
from within a postscript.  The wsuser user and policy must, of course, be
set up first.

Question 1. Is there any reason not to use curl and the REST API from
postscripts during an install?   Does this duplicate existing xCAT
functionality?

Question 2.  It’s difficult to protect  the “wsuser” password coded
into /install/postscripts/getnodeattr.   The file can’t be made read-only
root, for example, because httpd needs to be able to read it.   Is there a
way to limit “wsuser” to GET calls?

Thanks,

Goran
------------------------------------------------------------------------------

LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

<<inline: graycol.gif>>

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
xCAT-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xcat-user

Reply via email to