[wpkg-users] default profile?

Rainer Meier r.meier at wpkg.org
Mon Apr 25 19:10:40 CEST 2011


Hi Joe,

On 25.04.2011 17:50, Joe wrote:
> It's not clear to me but is there a way to have a default profile?
> Such that any package listed will install to all hosts, then any
> package defined in other profiles will install to that profile?

Well such a configuration is possible. However the way you describe it (a
profile which includes all packages defined in any other profile) does probably
not make sense in most environments.

If you want to achieve this then just define a profile which depends on all
other profiles (profiles.xml):

<profile id='all'>
  <depends profile-id='default' />
  <depends profile-id='profile1' />
  <depends profile-id='profile2' />
  <depends profile-id='profilex' />
</profile>

However often you want to create a profile which is assigned to any host for
which there is no specific definition just use something like this in hosts.xml:

<wpkg>
  <host name='prefix-.*' profile-id='profile1' />
  <host name='hosty' profile-id='profile2' />
  <host name='special-host-z' profile-id='profilex' />
  <host name='.*' profile-id='default' />
</wpkg>

In this example all hosts whose names start with "prefix-" would be assigned
profile1, the host named "hosty" gets profile2 assigned etc.
Any host not matching any previous host definition will be catched by the
regular expression ".*" which just matches everything. So any host not matched
by previous host definitions are getting profile "default" assigned.


So if you want all hosts to have the same set of default packages just do
something like:

<profile id='default'>
  <package package-id='package1' />
  <package package-id='package2' />
</profile>

<profile id='profile1'>
  <depends profile-id='default' />
  <package package-id='package3' />
</profile>

<profile id='profile2'>
  <depends profile-id='default' />
  <package package-id='package4' />
  <package package-id='package5' />
</profile>
...

As all profiles have a dependency on the "default" profile this makes WPKG
"include" the defintions in the "default" profile into the scope of profile1 and
profile2. So if you update something in the "default" profile it will affect
profile1/profile2-hosts too.

br,
Rainer



More information about the wpkg-users mailing list