Forum: CFEngine Help
Subject: Re: Trying to use a variable inside a regex
Author: neilhwatson
Link to topic: https://cfengine.com/forum/read.php?3,27490,27491#msg-27491
What does getsebool return? The following works in 3.4.0b1.
body common control {
bundlesequence => {
"main",
};
inputs => {
"cfengine_stdlib.cf",
};
}
bundle agent main {
methods:
"virt_use_nfs" usebundle => set_selinux_boolean ( "virt_use_nfs_off", "off");
}
bundle agent set_selinux_boolean(s, i){
classes:
"sebooloff" expression => regcmp(".*$(i)$", execresult("/bin/echo $(s)",
"noshell"));
reports:
sebooloff::
"$(s) is off.";
}
:~/.cfagent/inputs$ cf-agent -IKf ./varregex.cf
R: virt_use_nfs_off is off.
!! Method invoked repairs
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine