Forum: Cfengine Help (Mailing list)
Subject: Re: class visibility
Author: RIngersoll
Link to topic: https://cfengine.com/forum/read.php?3,16590,16593#msg-16593

If you used the readfile (or another read...) function and regcmp rather than a 
files promise you could do it in the common bundle.  Here's an example you 
might be able to adopt:


bundle common glb

{
vars:
    linux::
        "linuxtype"     string  => readfile( "/etc/redhat-release", "60" );

classes:
    linux::
        "redhat4"       expression      => regcmp(".*Nahant.*",  
"$(linuxtype)"); 
        "redhat5"       expression      => regcmp(".*Tikanga.*", 
"$(linuxtype)"); 
        "oraclevm"      expression      => regcmp(".*Oracle.*",  
"$(linuxtype)"); 
}


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

Reply via email to