Hi,

Maybe you could use something like this :

bundle agent check_nagios_installation {
    files:
        "${nagios_install_dir}/"
        create => "true",
        comment => "Creating nagios directory",
        classes => if_repaired("not_nagios_installed");
   commands:
      not_nagios_installed::
            "/bin/tar xzvf /var/cfengine/artifacts/nagios/nagios.tar.gz 
-C /",
                comment => "Going to install Nagios now.";
}
body classes if_repaired(class)
{
promise_repaired => { "$(class)" };
}




bernd.adamow...@external.icw-global.com wrote:
>
> I guess I'm facing a typical beginners problem, however, I didn't find 
> a solution.
>
> I'm checking the existence of a directory. If it's not there, I'm 
> going to extract a tarball which creates it and some other files. This 
> works very fine. However the extracting of the tarball is done 
> sometimes too, even if the directory exists. I couldn't find a 
> deterministic behaviour. Here's the code I'm using:
>
> bundle agent check_nagios_installation {
>
>     classes:
>         "nagios_installed" expression => 
> fileexists("${nagios_install_dir}/.");
>
>     commands:
>         !nagios_installed::
>             "/bin/tar xzvf 
> /var/cfengine/artifacts/nagios/nagios.tar.gz -C /",
>                 comment => "Going to install Nagios now.";
> }
>
> Thanks in advance!
>
> Bernd
> InterComponentWare AG:
> Vorstand: Jörg Stadler / Aufsichtsratsvors.: Prof. Dr. Christof Hettich
> Firmensitz: 69190 Walldorf, Industriestraße 41 / AG Mannheim HRB 
> 351761 / USt.-IdNr.: DE 198388516
> ------------------------------------------------------------------------
>
> _______________________________________________
> Help-cfengine mailing list
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
>   

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to