Forum: Cfengine Help
Subject: Turning on multiple classes on a file copy?
Author: jgreer
Link to topic: https://cfengine.com/forum/read.php?3,20803,20803#msg-20803
I need to turn on two classes when a Cfengine-managed file is repaired. I
would like to specify them without needing first to declare an slist variable
(I've posed a similar question before but am still unclear about whether the
language supports this). Here's the existing code - it works and turns on both
classes when cloudmark.conf is updated:
vars:
"prefix" string => "$(var.masterfiles)/dcsunix/Omr/pub";
"fileserver" slist => { @(var.fileserver) };
"cloudmark_conf_changed"
slist => { "ldconfig_change", "mimedefang_restart" };
files:
"/etc/ld.so.conf.d/cloudmark.conf"
copy_from => copy_std("$(prefix)/etc/ld.so.conf.d/cloudmark.conf",
"$(fileserver)", "false", "timestamp"),
classes => if_repaired( "@(cloudmark_conf_changed)" ),
perms => mode_owner_group("0444", "root", "root"),
action => actionsettings_fix_inform("inform");
Much like we pass scalars without first declaring them as string vars
('if_repaired( "ldconfig_change" )'), I would like to pass an slist before
first declaring it. I've tried several variations hoping that's supported, all
of which have resulted in syntax errors.
Is there something like:
classes => if_repaired( "{ "ldconfig_change", "mimedefang_restart" }" );
to mark a set of parameters as an slist?
Thanks,
-Jessica
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine