Profiles.xml

From WPKG | Open Source Software Deployment and Distribution
Jump to: navigation, search

This document in other languages: French Spanish


profiles.xml is a file which defines the software packages or scripts, which will be installed/executed on hosts.

This file has to be placed in the same directory as wpkg.js.

WPKG will not work without this file.

Hosts are defined in hosts.xml file.
Packages are defined in packages.xml file.


profiles.xml structure

The structure of profiles.xml is as follows:

<profiles>
    <profile id="default">
       <package package-id="acrobat" />
       <package package-id="firefox" />
    </profile>
    <profile id="custom">
       <depends profile-id="default" />
       <package package-id="thunderbird" />
    </profile>
</profiles>

Which means, that if a host, defined in hosts.xml has a profile default (the first profile above), it will have acrobat and firefox installed - because profile id="default" contains these two packages.

Now take a look at <depends profile-id="default" /> entry in the next profile - <profile id="custom">.
This profile only seems to contain a thunderbird package.
But because it depends on <profile id="default">, which contains two more packages (acrobat and firefox) - it all sums up, and in the end, a host with a profile custom will have three packages installed: acrobat, firefox and thunderbird.


This way you can easily create a group of packages to be installed on all workstations (for example, in profile default), and then create specific profiles for different rooms, departments etc.

Profiles can depend on more than one package.

Quick examples

<profiles>
    <profile id="default">
        <package package-id="firefox" />
    </profile>

    <profile id="custom">
        <depends profile-id="default" />
        <package package-id="thunderbird" />
        <package package-id="acrobat" />
    </profile>

    <profile id="basement">
        <package package-id="photoshop" />
    </profile>

    <profile id="administration">
        <depends profile-id="custom" />
        <package package-id="database" />
    </profile>
</profiles>

Individual XML profiles files

If you would rather keep your profiles XML description in separate files, you can of course do it: just create a profiles directory where wpkg.js is, and place individual XML files there (i.e., basement.xml, administration.xml etc.). The syntax is the same as that of profiles.xml.

Note, if you decide to keep all your profiles in separate XML files, still, you need to have profiles.xml file. It should at least contain an empty entry:

<profiles>
</profiles>

XSD schema for validation

<?xml version="1.0" encoding="utf-8"?>
<xs:schema attributeFormDefault="unqualified" elementFormDefault="qualified"
	   xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:complexType name="profileType">
		<xs:sequence minOccurs="0">
			<xs:choice maxOccurs="unbounded">
				<xs:element maxOccurs="unbounded"
					    name="depends"
					    type="dependsType">
				</xs:element>
				<xs:element maxOccurs="unbounded"
					    name="package"
					    type="packageType">
				</xs:element>
			</xs:choice>
		</xs:sequence>
		<xs:attribute name="id" type="xs:string" use="required" />
	</xs:complexType>
	
	<xs:complexType name="dependsType">
		<xs:attribute name="profile-id" type="xs:string" use="required" />
	</xs:complexType>
	<xs:complexType name="packageType">
		<xs:attribute name="package-id" type="xs:string" use="required" />
	</xs:complexType>

	<xs:element name="profiles">
	<xs:complexType>
	  <xs:sequence>
		<xs:element minOccurs="0" maxOccurs="unbounded"
			    name="profile" type="profileType">
		</xs:element>
	  </xs:sequence>
	</xs:complexType>
	</xs:element>
</xs:schema>

Uninstalling programs

To uninstall a program which was installed on one or more host computers, you just have to remove the program's entry from the profile. When synchronizing next time, the WPKG-script will uninstall the program as specified in the uninstall-section.

See also