Is one of the commands perhaps to create the directory you want? Why not use
the "create => true" attribute and just let the promises converge to the
desired state?
-Dan
> --===============1770191284==
> Content-Type: multipart/alternative; boundary=0016e6470cf819ef39048813b6ae
>
> --0016e6470cf819ef39048813b6ae
> Content-Type: text/plain; charset=ISO-8859-1
>
> I am trying to write a promise config that will first check to see if a
> directory exists. If it doesn't the run these commands. I am able to achieve
> this with files incombination with the "classes => if_repaired(xyz);". Any
> suggestions?
>
> Thank you,
>
> CFengine 3
>
> files:
>
> # directory example
> "/some/directory/."
> execute commandX
> execute commandY
>
> # works with files
> "/var/spool/cron/crontabs/www"
> copy_from =>
>
> umycopy("$(content_files)/solaris/10/all/var/spool/cron/crontabs/www"),
> perms => mog("0600","www","www"),
> classes => if_repaired(restart_cron);
>
> <other unrelated files below>
>
>
>
> commands:
> commandX::
> "/path/commandX";
>
> commandY::
> "/path/commandY";
>
> <other unrelated commands below>
> }
>
> --0016e6470cf819ef39048813b6ae
> Content-Type: text/html; charset=ISO-8859-1
> Content-Transfer-Encoding: quoted-printable
>
> <br>I am trying to write a promise config that will first check to see if a=
> directory exists. If it doesn't the run these commands. I am able to a=
> chieve this with files incombination with the "classes =3D> if_repa=
> ired(xyz);".=A0 Any suggestions?<br>
> <br>Thank you,<br><br>CFengine 3<br><br>files:<br><br>=A0=A0=A0 # directory=
> example <br>=A0=A0=A0 "/some/directory/."<br>=A0=A0=A0 =A0execut=
> e commandX<br>=A0=A0=A0 =A0execute commandY<br><br>=A0=A0=A0 # works with f=
> iles<br>=A0=A0=A0 "/var/spool/cron/crontabs/www"<br>
> =A0=A0=A0=A0=A0=A0=A0=A0 copy_from =3D><br>=A0=A0=A0=A0=A0=A0=A0=A0 umyc=
> opy("$(content_files)/solaris/10/all/var/spool/cron/crontabs/www"=
> ),<br>=A0=A0=A0=A0=A0=A0=A0=A0 perms =3D> mog("0600","www=
> ","www"),<br>=A0=A0=A0=A0=A0=A0=A0=A0 classes =3D> if_rep=
> aired(restart_cron);<br>
> <br>=A0=A0=A0 <other unrelated files below><br><br><br><br>commands:<=
> br>=A0=A0=A0 commandX::<br>=A0=A0=A0 "/path/commandX";<br><br>=A0=
> =A0=A0 commandY::<br>=A0=A0=A0 "/path/commandY";<br><br>=A0=A0=A0=
> <other unrelated commands below><br>
> }<br>=A0=A0=A0 <br>=A0=A0=A0 <br><br>
>
> --0016e6470cf819ef39048813b6ae--
>
> --===============1770191284==
> Content-Type: text/plain; charset="us-ascii"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline
>
> _______________________________________________
> Help-cfengine mailing list
> [email protected]
> https://cfengine.org/mailman/listinfo/help-cfengine
>
> --===============1770191284==--
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine