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

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search
m (New page: 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 def...)
 
m
Line 2: Line 2:
  
 
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:
 
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:
 
+
<pre>
 
<package id='test' name='testpackage'>
 
<package id='test' name='testpackage'>
 
<variable name='testlicencenumber' value='1234'/>
 
<variable name='testlicencenumber' value='1234'/>
Line 8: Line 8:
 
...
 
...
 
</package>
 
</package>
 
+
</pre>
 
which defines a default licence number. If we have a profile which needs a different value, we set:
 
which defines a default licence number. If we have a profile which needs a different value, we set:
 
+
<pre>
 
<profile id='others'>
 
<profile id='others'>
 
<variable name='testlicencenumber' value='6789' />
 
<variable name='testlicencenumber' value='6789' />
Line 16: Line 16:
 
...
 
...
 
</profile>
 
</profile>
 
+
</pre>
 
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:
 
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:
 
+
<pre>
 
<host name='pcn12' profile-id='others'>
 
<host name='pcn12' profile-id='others'>
 
<variable name='testlicencenumber' value='abcd' />
 
<variable name='testlicencenumber' value='abcd' />
 
...
 
...
 
</host>
 
</host>
 
+
</pre>
  
 
[[Category:Documentation]]
 
[[Category:Documentation]]

Revision as of 19:22, 30 September 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>