Forum: CFEngine Help
Subject: Convert soft class name to variable
Author: davinken
Link to topic: https://cfengine.com/forum/read.php?3,27338,27338#msg-27338

Is there any workaround to get the soft-class that would reflect the 
architecture of my system, 64_bit or 32_bit assigned to a variable ?

I have many configuration files or executables that depend on this, and are 
named e.g.:

/usr/local/bin/myfile.64_bit
/usr/local/bin/myfile.32_bit

as they reside in a golden files server referenced by $(def.goldenfilessrv) 
elsewhere.

So I would like to have CF3 copy my file in a promise such as:

vars:
  "myfile" string => "  "/usr/local/bin/myfile";

file:
  "$(myfile)"
        copy_from => remote_dcp( "$(def.fcfdir)$(myfile).$(architecture)", 
"$(def.goldenfilessrv)" ),
        perms => mog( "755", "root", "root" );



where the variable "architecture" is set to either "64_bit" or "32_bit" 
according to the soft-detected class with those same values.

Any hints ?

Thanks

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

Reply via email to