Difference between revisions of "Hosts.xml"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
Line 17: Line 17:
  
 
Which means, that a hostname with a name ''host1'' will use a profile ''custom1'', and a hostname with a name ''host2'' will use a profile ''custom2''.
 
Which means, that a hostname with a name ''host1'' will use a profile ''custom1'', and a hostname with a name ''host2'' will use a profile ''custom2''.
 +
 +
If you have more hosts, or want to group them, it would be unwise to edit dozens of host entries just to attach them all to one or two profiles.
 +
That's why you can use regular expressions.
 +
You can view the exact syntax on [http://msdn.microsoft.com/library/default.asp?url=/library/en-us/jscript7/html/jsjsgrpregexpsyntax.asp this page].
 +
 +
 +
 +
Quick examples:
 +
 +
<host name="b[0-9]+" profile-id="profile" />
 +
 +
works for:              b1, b10, b100
 +
does not work for:      bubu, b, x, x1, x10, x100
 +
 +
 +
<host name=".+" profile-id="profile" />
 +
 +
works for *all* hosts - use with care (!), place at the bottom of hosts.xml
 +
 +
 +
<host name="b.+" profile-id="profile1" />
 +
 +
works for "b10", "b11", "b12345" etc.
 +
 +
 +
<host name="b.+" profile-id="profile2" />
 +
<host name="bronek1" profile-id="profile1" />
 +
<host name="bron.+" profile-id="profile3" />
 +
 +
Normally, hosts are parsed from top to the bottom, except when the hostname is not a regular expression.
 +
So host "bronek" will match "profile1", even though it also matches "b.+" and "bron.+" (which are regular expressions).
 +
  
 
Profiles are defined in [[packages.xml]].
 
Profiles are defined in [[packages.xml]].

Revision as of 12:09, 25 June 2005

hosts.xml is a file which defines the the hosts and the profiles, which this hosts will use.

It has to be placed in the same direstory as wpkg.js.

WPKG will not work without this file.


The structure of hosts.xml is the following:

<wpkg>
<host name="host1" profile-id="custom1" />
<host name="host2" profile-id="custom2" />
</wpkg>

Which means, that a hostname with a name host1 will use a profile custom1, and a hostname with a name host2 will use a profile custom2.

If you have more hosts, or want to group them, it would be unwise to edit dozens of host entries just to attach them all to one or two profiles. That's why you can use regular expressions. You can view the exact syntax on this page.


Quick examples:

<host name="b[0-9]+" profile-id="profile" />

works for: b1, b10, b100 does not work for: bubu, b, x, x1, x10, x100


<host name=".+" profile-id="profile" />

works for *all* hosts - use with care (!), place at the bottom of hosts.xml


<host name="b.+" profile-id="profile1" />

works for "b10", "b11", "b12345" etc.


<host name="b.+" profile-id="profile2" /> <host name="bronek1" profile-id="profile1" /> <host name="bron.+" profile-id="profile3" />

Normally, hosts are parsed from top to the bottom, except when the hostname is not a regular expression. So host "bronek" will match "profile1", even though it also matches "b.+" and "bron.+" (which are regular expressions).


Profiles are defined in packages.xml.