Good evening. I am trying to confirm the ownership of the /etc/fstab file. If the owner is root then set the "confirmed" class. Am I completely off base with this example?

# ls -l /etc/fstab
-rw-r--r-- 1 root root 844 May 8 2010 /etc/fstab


########
body common control
{
bundlesequence => { "test" };
inputs => { "cfengine_stdlib.cf" };
}

bundle agent test
{
vars:
"myuser" string => "root";

files:
"/etc/fstab"
file_select => example($(myuser)),
classes => if_ok("confirmed");

confirmed::
"/tmp/ItsAMatch"
comment => "Ownership was confirmed",
create => "true";

}

body file_select example(user)
{
search_owners => { $(user) };
file_result => "owner";
}

########

CF 3.1.2
Reference: http://www.cfengine.org/manuals/cf3-reference.html#file_005fselect-in-files
_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to