Difference between revisions of "Variable setting through hosts/profiles/packages"

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m
m
 
Line 28: Line 28:
 
</host>
 
</host>
 
</pre>
 
</pre>
 +
 +
Note: this feature is available in WPKG 0.9.12 and later.
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]

Latest revision as of 13:47, 1 October 2007

Imagine having several research groups using WPKG. This can raise a few difficulties - some have different licence keys etc. To get around this, it is possible to allow variables to be defined in hosts.xml, profiles.xml and packages.xml.

To take an example, say most people use a licence number of 1234 but there are some others who need 6789. We might be able to define the package as:

<package id='test' name='testpackage'>
<variable name='testlicencenumber' value='1234'/>
<install cmd='setup.exe /licence=%testlicencenumber%'/>
...
</package>

which defines a default licence number.

If we have a profile which needs a different value, we set:

<profile id='others'>
<variable name='testlicencenumber' value='6789' />
<package package-id='test'/>
...
</profile>

This setting of the variable in the profile over-rides that set in the package.

Likewise, a variable set in hosts.xml over-rides any set in profiles or packages so we can accommodate an individual host using a licence number "abcd" by:

<host name='pcn12' profile-id='others'>
<variable name='testlicencenumber' value='abcd' />
...
</host>

Note: this feature is available in WPKG 0.9.12 and later.