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&#39;t the run these commands. I am able to a=
> chieve this with files incombination with the &quot;classes =3D&gt; if_repa=
> ired(xyz);&quot;.=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 &quot;/some/directory/.&quot;<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 &quot;/var/spool/cron/crontabs/www&quot;<br>
> =A0=A0=A0=A0=A0=A0=A0=A0 copy_from =3D&gt;<br>=A0=A0=A0=A0=A0=A0=A0=A0 umyc=
> opy(&quot;$(content_files)/solaris/10/all/var/spool/cron/crontabs/www&quot;=
> ),<br>=A0=A0=A0=A0=A0=A0=A0=A0 perms =3D&gt; mog(&quot;0600&quot;,&quot;www=
> &quot;,&quot;www&quot;),<br>=A0=A0=A0=A0=A0=A0=A0=A0 classes =3D&gt; if_rep=
> aired(restart_cron);<br>
> <br>=A0=A0=A0 &lt;other unrelated files below&gt;<br><br><br><br>commands:<=
> br>=A0=A0=A0 commandX::<br>=A0=A0=A0 &quot;/path/commandX&quot;;<br><br>=A0=
> =A0=A0 commandY::<br>=A0=A0=A0 &quot;/path/commandY&quot;;<br><br>=A0=A0=A0=
>  &lt;other unrelated commands below&gt;<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
> Help-cfengine@cfengine.org
> https://cfengine.org/mailman/listinfo/help-cfengine
> 
> --===============1770191284==--
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to