[wpkg-users] profile question

Natxo Asenjo natxo.asenjo at gmail.com
Mon Feb 21 14:14:00 CET 2011


On Fri, Feb 18, 2011 at 2:09 PM, Falko Trojahn
<nospam_ft at smi-softmark.de> wrote:
> Hi,
>
> On 18.02.2011 10:22, wrote Natxo Asenjo:
>> hi,
>>
>> is it possible to apply a profile depending on the result of a command?
> I think this should be possible with recent wpkg.js versions:
>
> - create a package "checkpkg" which has one (or more) "execute" check(s)
>  http://wpkg.org/Packages.xml#Execute
>
> - create a profile (or package) which depends first on this "checkpkg"
>
> -> the profile only gets installed when checkpkg is installed,
>     which is only installed when the execute check returns true ...

hi again,

we have two types of servers: fujitsu primergy 300 s3 and dell poweredge r410.

With wmi I get to check which one is which:

echo '' | wmic  computersystem get /format:list | findstr /i "PRIMERGYRX300 S3"

echo '' | wmic  computersystem get /format:list | findstr /i "PowerEdge r410"

if either of those returns 0, then it is either a primergy or a
poweredge. This works fine.

I created two new packages:

<package
        id="is_poweredge_r410"
        name="check if this is a Dell PowerEdge R410"
        revision="1"
        reboot="false"
        priority="10000" >


        <check      type="execute"
path="%software%\dell-openmanage\check_dell_pe_r410.cmd"
condition="exitcodeequalto" value="0" />

    </package>

<package
        id="is_primergyrx300_s3"
        name="check if this is a PRIMERGY RX300 S3"
        revision="1"
        reboot="false"
        priority="10000" >


        <check      type="execute"
path="%software%\fujitsu\check_primergyrx300s3.cmd"
condition="exitcodeequalto" value="0" />

    </package>

Then I created 2 new profiles:

<profile id="primergy_rx300_s3" >
        <depends    package-id="is_primergyrx300_s3"    />

        <package    package-id="serverview_raid_32"     />
        <package    package-id="serverview_agent"       />
    </profile>

    <profile id="poweredge_r410" >
        <depends    package-id="is_poweredge_r410"      />

        <package    package-id="openmanage-32bit"       />
    </profile>

And I added these 2 new profiles to an existing profile, so that if
the wpkg evaluates what hardware the systems have and automatically
installs the right software for the servers.

Unfortunately, it installs everything, so now the test fujitsu server
also has openmanage from dell :-); I do not have a test dell server
yet (tomorrow), but so far it is not doing what I want.

What could be going wrong? I have checked that the fujitsu server does
not return 0 for the dell check, so why is it installing openmanage?

TIA,

--
natxo



More information about the wpkg-users mailing list