On 03/28/11 16:23, Scott Henson wrote:
On Mon, 28 Mar 2011 09:02:20 -0400, Gary Algiergaa@ulticom.com wrote:
Hello,
I would like to write a cobbler trigger to do something every time I add a system. I looked at the documentation at: https://fedorahosted.org/cobbler/wiki/CobblerTriggers
The best example I can give you is the triggers found in the modules directory in the cobbler source [1]. The install_* ones and sync_* ones. The api passed in is a copy of BootAPI (which is the actual name of CobblerAPI). It is normally not ok to use BootAPI for various reasons, but in this case the trigger is running inside of cobblerd and can safely make use of BootAPI.
[1] - http://git.fedorahosted.org/git/?p=cobbler;a=tree;f=cobbler/modules;h=a6f0c1...
How do I specify a module to be run pre-system-add?
Using an executable I would put it in: /var/lib/cobbler/triggers/add/system/pre with a name of my choosing. Do I create a similar directory structure and place it in: /usr/lib/python2.4/site-packages/cobbler/modules/add/system/pre ?
How does it know when to apply the modules in: /usr/lib/python2.4/site-packages/cobbler/modules/ or are they applied on every operation?
It looks like they are run every time and the register function tells cobbler when it should be used, but it only seems to define pre vs post.