On Mon, May 16, 2011 at 3:47 AM, Nicolas Charles
<nicolas.char...@normation.com> wrote:
> In the body class, you have "persist_time" that allows you to set the
> number of minutes the related class should remain active
>
> In the cfengine_stdlib.cf :
>
> body classes state_repaired(x)
> {
> promise_repaired =>  { "$(x)" };
> persist_time =>  "10";
> }

I am having trouble getting this to work.

::::::::::::::
define_persistent_class.cf - set  a persistent class
::::::::::::::
bundle agent example {

classes:
   "a_persistent_class"
        comment => "Set a custom persistent class based on built-in classes",
        expression => "linux|solaris",
        classes => persist_for_ten_minutes;

}

body classes persist_for_ten_minutes
{
persist_time => "10";
}


cf-agent -v shows a private class is set:

cf3>    =========================================================
cf3>    classes in bundle example (3)
cf3>    =========================================================
cf3>
cf3> Initiate variable convergence...
cf3>
cf3>      +  Private classes augmented:
cf3>      +       a_persistent_class
cf3>


However, when I run cf-agent again to check for this class,

::::::::::::::
show_persistent_class.cf
::::::::::::::
bundle agent example {

reports:
  a_persistent_class::
    "I see persistent class a_persistent_class.  $(sys.date)";
}



cf-agent don't see it.  cf-agent -v does not show it loaded as a
persistent class.

cf3> ***********************************************************
cf3>  Loading persistent classes
cf3> ***********************************************************

I imagine if there were any classes to loaded, they would be shown loaded
in this section of the verbose output.

Could anybody show me a complete runnable example of how to set a
persistent class, please?

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

Reply via email to