On 01/27/2010 09:15 PM, Adam Young wrote:
Here are the current set of values for token replacement. I'm willing
to modify them based on feedback.
All of the following tokens start with "rhq.system."
hostname
os.name
os.version
os.type
cpu.count
architecture
For network adapters the key will start with "rhq.system.interfaces."
followed by the network adapter name; i.e. eth0
.mac
.type
.flags
The way that system info is set up right now, there is a list of IP
addresses associated with the network adapter. For now, I will pull out
the first one and assume it is the only one, but this is probably not
the right solution. The same goes for multicast.
.address
.multicast.address
Looking at the satellite macros, I see the following missing. Some may be satellite specific tho..
• rhn.system.sid
• rhn.system.profile_name
• rhn.system.description
• rhn.system.net_interface.netmask(eth_device)
• rhn.system.net_interface.driver_module(eth_device)
Did we bail on doing traits? Or, are all the traits on the platform from here?
Type: Linux (Platform) | Description: Linux Operating System |
Version: Linux 2.6.30.9-96.fc11.x86_64 | Parent: none |
Hostname: ayoung.boston.devel.redhat.com | Architecture: x86_64 |
OS Name: Linux | Distribution Name: Fedora |
OS Version: 2.6.30.9-96.fc11.x86_64 | Distribution Version: release 11 (Leonidas) |
In order to use the templating engine, call:
org.rhq.core.system.SystemInfoFactory.fetchTemplateEngine. I partnered
this with the SystemInfoFacotry since that was bascially the major
dependecy for getting this to work. Again, I am not wedded to that, but
it seems the cleanest place to put it.
And example of using it is checked in to the ConfigurationManager:
TemplateEngine templateEngine = SystemInfoFactory.fetchTemplateEngine();
...
for (RawConfiguration rawConfig : configuration.getRawConfigurations()) {
String contents = templateEngine.replaceTokens(new
String(rawConfig.getContents()));
....
Can I add to the list above with new tokesn?
-- bk