Forum: CFEngine Help
Subject: Re: ifvarclass IN Reports
Author: phnakarin
Link to topic: https://cfengine.com/forum/read.php?3,22973,22977#msg-22977

Worked fine for me in 3.2.0b3 so that would be a bug in 3.1.5.


body common control {
bundlesequence => { "test" };
}

bundle agent test {
vars:
"test_disks" slist => {
"/tmp/test1",
"/tmp/test2",
};
files:
"$(test_disks)"
create => "true",
classes =>
kept_rep_err("$(test_disks)_ok","$(test_disks)_fixed","$(test_disks)_err");
reports:
cfengine_3::
"$(test_disks) : ok" ifvarclass => canonify("$(test_disks)_ok");
"$(test_disks) : fixed" ifvarclass => canonify("$(test_disks)_fixed");
"$(test_disks) : err" ifvarclass => canonify("$(test_disks)_err");
}
body classes kept_rep_err(kept,rep,fail) {
promise_kept => { "$(kept)" };
promise_repaired => { "$(rep)" };
repair_failed => { "$(fail)" };
repair_denied => { "$(fail)" };
repair_timeout => { "$(fail)" };
}


root@ubuntu1:/tmp/cfengine-3.2.0b3# src/cf-agent -V

   @@@      
   @@@      cf-agent
            
 @ @@@ @    CFEngine Core 3.2.0b3
 @ @@@ @    
 @ @@@ @    
 @     @    
   @@@      
   @ @      
   @ @      
   @ @      

Copyright (C) Cfengine AS 2008-2011

root@ubuntu1:/tmp/cfengine-3.2.0b3# src/cf-agent -f /tmp/xxx.cf -IK
 -> Created file /tmp/test1, mode = 600
 -> Created file /tmp/test2, mode = 600
R: /tmp/test1 : fixed
R: /tmp/test2 : fixed

root@ubuntu1:/tmp/cfengine-3.2.0b3# src/cf-agent -f /tmp/xxx.cf -IK
R: /tmp/test1 : ok
R: /tmp/test2 : ok


Cheers,
--Nakarin

_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to