I understand that cfengine's normal ordering is: vars, classes, outputs, and so on. What I'm trying to do is restrict an "execresult" call in the "vars:" section of a bundle to a particular class.

I've tried defining the class globally as well as implementing a depends_on / handle dependency to indicate the class should be set first. See below:

   bundle agent test {

     vars:

            cfmaster::
            "sshpubkey" string => execresult("/usr/bin/ssh-keygen -y -f
   /etc/ssh/ssh_host_rsa_key","noshell"),
            depends_on => "foo";


     classes:

            "cfmaster" or => { "cfengine3" },
            handle => "foo";


However whenever cf-agent runs it skips over the "cfmaster" class as not being relevant.

   cf3    =========================================================
   cf3    vars in bundle test (1)
   cf3    =========================================================
   cf3
   cf3
   cf3 . . . . . . . . . . . . . . . . . . . . . . . . . . . .
   cf3 Skipping whole next promise (sshpubkey), as context cfmaster is
   not relevant



It seems like cf3 will adhere to hard classes in the "vars:" section. Is there any way to incorporate soft classes without changing normal ordering?

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

Reply via email to