With the release of 1.3.0RC16 basic persistent groups have been added to the system via a plugin. The developers were kind enough to write a plugin wrapper for the mysql trigger I created in this post: https://forums.fogproject.org/topic/6902/fog-1-3-persistent-groups
Please understand that persistent groups are not officially supported by the developers since they only wrote the plugin wrapper for the sql trigger. With the use of this plugin wrapper its no longer necessary to go into mysql and paste in the trigger as it was defined in the link above. This plugin is already installed in RC16 and should be added the norm way plugins are added into fog.
This plugin started out as a need to have persistent groups in FOG. I was a bit confused about the built in grouping in fog when I started using it as many others. I would create a group in fog, set a parameter for that group, press OK and the parameter would disappear. After banging my head against the wall thinking that I was doing something wrong I reached out to the developers to say something was broken with fog groups. The developers explained how FOG groups really worked. (These are my words not theirs), The groups in FOG are what I might call set groups, in that you can assign hosts to a group and then key in a parameter and then that parameter is copied to all hosts in the group. That setting does not stick in the group definition. If you add a host later to the group the setting I created yesterday will not be applied to this new host when its added to the group. This is not what I needed for my FOG environment. I have 3 or 4 classes of computers, each of these classes have their own specific OU settings, their own combination of snapins and other unique settings. I wanted to add a new computer to the CAD group and have all of the settings specific to the CAD group applied to that new system. The same would go for the production class and the office class. Each have their own individual characteristics.
Since I didn’t know how to program in FOG or create plugins I reverted back to something I’m quite familiar with SQL. I though that if I could create a sql trigger that when a host is added to a specific template group that database trigger event could then update the inserted host with a predefined host template. I could do this without having to program fog or change the programming in any way. This hack is done outside of the scope of fog and its management control since it executed at the database level.
Before we get started here we need to get some terminology defined.
Host template := is a non deployable host where you set the predefined values you want copied to your destination hosts. At this time a template host may only be associated with a single template group.
Template group := is a group that is associated with a single template host. A template group can contain many hosts, but may only be associated with a single template host.
The way the sql trigger works is when you add a new host to a template group, the sql trigger fires and erases all existing snapin, location, (and and) parameters from the new host and then copies the settings from the template host to the new host. Understand the way the trigger works is that it only fires when the host is first added to the group. If you change a parameter in the template host, this value is NOT automatically copied to all hosts in the template group. If this is what you need you should use the traditional fog (set) groups for this. Also note when you remove a host from a template group the settings are not removed from the new host. So in a way the template groups and template hosts are a set only group (which functions the same way as the traditional FOG groups, except the settings are remembered in the template host).