* On Wed, 23 Feb 2011 at 8:33 -0500, Daniel V. Klein wrote: > The promises look good, and AFAICT you should always get 2 lines, but I'd > suggest the following change for you: > > vars: > any:: > "dns" string => "192.168.1.20"; > machineX:: > "search" string => "domain2"; > !machineX:: > "search" string => "domain1"; > > This makes it clearer what variables are set under what conditions, and there > is no need for the policy "free" any more, because there is no reassignment.
Yes, that's true. How would cfengine react, if the variables are not set - would that be a reason to skip a line? The second promise, where I have problem with, is constructed the following way: bundle agent some_bundle { vars: class1|class2:: "jboss[heapmin]" int => "256"; "jboss[heapmax]" int => "2048"; class1:: "jboss[permsize]" int => "512"; class2:: "jboss[permsize]" int => "384"; ... } bundle edit_line jboss_runconf_template(v) { vars: "jbossmem" string => "-Xms$($(v)[heapmin])m -Xmx$($(v)[heapmax])m -XX:MaxPermSize=$($(v)[permsize])m"; insert_lines: "JAVA_OPTS=\"$(const.dollar)JAVA_OPTS $(jbossmem)\""; "JAVA_OPTS=\"$(const.dollar)JAVA_OPTS -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000\""; some_class:: "JAVA_OPTS=\"$(const.dollar)JAVA_OPTS -Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=100 80\""; other_class:: "JAVA_HOME=\"$($(v)[JAVA_HOME])\""; } Here, all the variables are set without redefinition. With this configuration, sometimes the first line (containing jbossmem) disappeared - preferrably in the middle of the night, when surely nobody is touching the system :-/ But even weirder - I have also once seen (only with 3.1.4), that only the line containing jbossmem was generated, the others were missing. Avoiding edit_defaults=>empty would of course avoid the problem, because then no lines would disappear, but it would have to take care about removing lines/parameters which should no longer be there (in case of changes). Regards, Adalbert _______________________________________________ Help-cfengine mailing list Help-cfengine@cfengine.org https://cfengine.org/mailman/listinfo/help-cfengine