[wpkg-users] Exclude a computer
Rainer Meier
r.meier at wpkg.org
Wed Dec 21 11:51:26 CET 2011
Hi Stefan,
On 21.12.2011 11:45, Stefan Pendl wrote:
> If you still want to use just one single profile, but exclude one package from
> one host you can use the conditions introduced with WPKG v1.3.0
Oh, just noticed that one of my answers did not hit the list as Bruno answered
to me directly and I've replied... Just for completeness on the list... Looks
like we came to the same conclusion. Bruno is going for the conditional-exclude
as he told me.
Hi,
On 20.12.2011 16:40, Bruno CHOQUET wrote:
> Hi :)
>
> This is not possible for me because i have 2 networks : NET1 and NET2
>
> Computer TOTO is in the NET1.
> NET1 uses "ONLYNET1" profile, that depends of "ALL NETWORKS" profile.
> NET2 uses directly "ALL NETWORKS" profile.
>
> "ALL NETWORKS" profile contains the 30 packages, include "Foxit".
So you say your structure looks as follows:
<profile id='ONLYNET1'>
<depends profile-id='ALL_NETWORKS' />
<package .... />
</profile>
<profile id='ALL_NETWORKS'>
<package .... />
<!-- all your 30 packages -->
</profile>
And TOTO is assigned to ONLYNET1.
So why isn't it possible do do it as follows?
<profile id='TOTO'>
<depends profile-id='CommonToolsToto' />
<package .... />
</profile>
<profile id='ONLYNET1'>
<depends profile-id='ALL_NETWORKS' />
<package .... />
</profile>
<profile id='ALL_NETWORKS'>
<depends profile-id='CommonTools' />
</profile>
<profile id='base'>
<package .... />
<!-- all your 29 packages -->
</profile>
<profile id='CommonTools'>
<depends profile-id='base' />
<package package-id='Foxit' />
</profile>
<profile id='CommonToolsToto'>
<depends profile-id='base' />
</profile>
I was assuming that ONLYNET1 will remain independent from TOTO, so you can
assign the TOTO profile to the TOTO host and still have to maintain your base
package set only once, in the 'base' profile.
Alternatively just use
<profile id='TOTO'>
<depends profile-id='base' />
<package .... />
</profile>
<profile id='ONLYNET1'>
<depends profile-id='ALL_NETWORKS' />
<package .... />
</profile>
<profile id='ALL_NETWORKS'>
<depends profile-id='CommonTools' />
</profile>
<profile id='base'>
<package .... />
<!-- all your 29 packages -->
</profile>
<profile id='CommonTools'>
<depends profile-id='base' />
<package package-id='Foxit' />
</profile>
So TOTO will have the base profile assigned and ONLYNET1 + ALL_NETWORKS still
use CommonTools including Foxit.
Alternatively WPKG 1.3.0 supports advanced host matching, but I do not recommend
this for this use case:
<profile id='CommonTools'>
<package package-id='Foxit'>
<condition>
<check type="logical" condition="not">
<check type="host" condition="hostname" value="^TOTO$" />
</check>
</condition>
</package>
<!-- all your 30packages -->
</profile>
I would rather refer to this as an "ugly hack" which is hard to maintain on your
side, but it would exclude the package "Foxit" on all nodes named "TOTO".
Remember: It works for WPKG 1.3.0 and newer only.
br,
Rainer
More information about the wpkg-users
mailing list