CFEngine
101
A centralized configuration management tool, with similar purpose like Puppet, Chef. But quite different modeling mechanism. Optimist view: Don't repeat, do things once. Pessimist view: it is an error replicator at high speed. ie. Be careful what you do, there is no roll back feature build in. There is no undo per se. Fixing is really adding new rule to check for the error and apply another change.Syntax
space matters. !FileExists works. ! FileExists (ie with a space after !) don't! function(...) is good. don't add spaces around ( ) !! class1|class2 | = or condition1.condition2 . = AND class1.cond1|class2.cond1 AND preceds OR (class1|class2).cond1 ( ) does NOT alter the conditions... mixed success.... sometime it is taken verbatim as part of name?? (class1.cond1|cl2.cond2).cond3 this seems to have worked under shellcommands: clause (or maybe it didn't work which is why it was commented out. there is no real diff b/w class1 vs cond1... ie, they are just grp definitions.
Process clause
processes: # only check for running process for host with the group named "uge_exechost" uge_exechost:: # run a ps -ef, see if it match the quoted line below "/opt/gridengine/bin/lx-amd64/sge_execd" # if not, run the command in the restart in the line below restart "/sbin/service sgeexecd.ugemaster start"ref: https://cfengine.com/archive/manuals/cf-manuals/cf2-Reference#processes
Commands/Troubleshooting
cfexecd -F in cron save files in /var/cfengine.- state/allclasses : list all classes defined in the cfEng config that this host matched. cfagent -qv, Defined classes are the classes that is listed in this file. (useful to define both positive and negative class in cf so that ensure host is at least "sourcing" the expected cf file. eg: has_sge and need_sge with FileExist and !FileExist fn tests.
- inputs/ : all the cf config files from cfengine master server is copied to the client machine in here. sometime the files are stale :( so check to see if it got refreshed if somehow updated config should work but don't!
- outputs/previos and the subdir as a whole : contain output of commands in the cf files that got executed on the host.
- cfengine_lock_db sometime is stale and prevents proper update. removing it once a day seemed like a good strategy.
See also
puppetCopyright info about this work
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike2.5 License.
Pocket Sys Admin Survival Guide: for content that I wrote, (CC)
some rights reserved.
2005,2012 Tin Ho [ tin6150 (at) gmail.com ]
Some contents are "cached" here for easy reference. Sources include man pages,
vendor documents, online references, discussion groups, etc. Copyright of those
are obviously those of the vendor and original authors. I am merely caching them here for quick reference and avoid broken URL problems.
Where is PSG hosted these days?
http://tin6150.github.io/psg/psg2.html
This new home page at github
http://tiny.cc/tin6150/ New home in 2011.06.
http://tin6150.s3-website-us-west-1.amazonaws.com/psg.html (coming soon)
ftp://sn.is-a-geek.com/psg/psg.html My home "server". Up sporadically.
http://tin6150.github.io/psg/psg.html
http://www.fiu.edu/~tho01/psg/psg.html (no longer updated as of 2007-05)
http://tiny.cc/tin6150/ New home in 2011.06.
http://tin6150.s3-website-us-west-1.amazonaws.com/psg.html (coming soon)
ftp://sn.is-a-geek.com/psg/psg.html My home "server". Up sporadically.
http://tin6150.github.io/psg/psg.html
http://www.fiu.edu/~tho01/psg/psg.html (no longer updated as of 2007-05)