I recently built a new file server and I based it on the well renowned FreeNAS by iXsystems. It’s been pretty solid over the past few weeks but today I ran into an issue. The web ui stopped responding. Actually it turned out that the django service had stopped. Well, that was the perfect opportunity to use CFEngine to make sure I never have the issue again. I grabbed the cfengine community 3.
You never know when the Zombie or Cloud Apocalypse is coming. It’s good to be able to locate those buried bodies quickly and easily. OK, enough bad jokes, but haven’t you ever looked at some CFEngine policy and wondered to yourself, exactly what does “delete => tidy” or some other body or bundle do? I have. I even wrote a crappy little perl script to locate the files that contained a specific body or bundle and then print out the single body or bundle.
I want to take a minute to thank Thomas Leyer for all of his hard work and dedicated service to the LOPSA Mentorship Program Team. Thomas has been a volunteer since the programs inception, and has chaired the program for the past three years! Thanks Thomas! I think the mentorship program is one of the best things that LOPSA offers. You should consider participating. It’s a great experience whether you choose to participate in the core team, as a mentor or as a protégé, I guarantee you will learn something, and you will be affecting the future of the profession.
Today I start a new journey with some of the smartest people on the planet. I have accepted a position with CFEngine. Primarily I will be assisting customers with the evaluation, design, implementation and policy writing. If you know me from the CFEngine community, don’t worry I only plan to increase my activity and continue to help in any way I can. Now one of my favourite hobbies is my job!
John Sanders shared a pattern for canonifying lists in #CFEngine on irc.freenode.net yesterday. It’s a useful reference so I thought I would replicate it here. 1 2 3 4 5 6 <td class="line-data"> <pre class="line-pre"><div class="line" id="file-output-LC1"> % cf-agent -KIf ./example_canonify_list.cf R: canonified site: www_example_com R: canonified site: www_example2_com R: alternate canonified site: www_example_com R: alternate canonified site: www_example2_com !! Method invoked repairs <div class="gist-meta"> <a href="https://gist.github.com/nickanderson/5271023/raw/d57a43831308cf31f0a5fe237b3d3436ed3d3049/Output" style="float:right">view raw</a> <a href="https://gist.
There is a known bug where getindices is unable to get the index of a dynamically generated array until the next pass. This comes up from time to time so I thought I would post an example using a pattern shared on the CFEngine help mailing list. The policy below shows 3 working examples. They are mostly similar, example0 shows the simplest workaround, example1 and example2 in addition show ways to suppress the “Duplicate selection of value for variable” messages.
bundle common knowledge(status) { vars: "software" string => "$(status)", policy => "free"; !isUsable:: "software" string => "usable", policy => "free"; isUsable:: "software" string => "reusable", policy => "free"; classes: "isUsable" expression => regcmp("$(software)", "usable"); "reUsable" expression => regcmp("$(software)", "resuable"); reports: Morning|Afternoon|Evening|Night:: "Before software can be reusable it first has to be useable.", comment => "Ralph Johnson"; }
Changelogs are just as important as the most important meal of the day. OK so I don’t always eat breakfast, but I do make an effort to read changelogs. CFEngine 3.4.2 was released today. What I found interesting was that the default masterfiles policy has been updated. body executor control now calls $(sys.workdir)/inputs/update.cf instead of failsafe.cf. And $(sys.workdir)/failsafe/failsafe.cf (which was new as of 3.4.0) is gone. I think its a good change.
Sometimes you want to know what value zenoss has for something. The numbers sent in alerts seem to be the value that zenoss has, but the graphs are usually formatted to make more sense. 1394606080 might come in an alert, but on the graph it would show as 1.3 or 1.4G. It can cause some slight confusion when other people expect 90% of 1.4G instead of 90% of 1394606080 to be an alert threshold.
Over the past several months 2 years (since 3.1.2 release, wow time flys when your having fun. I checked and 3.1.2 was released on Dec 9th 2010.) I have seen a few questions regarding how the default CFEngine policy update works, and more specifically how cf_promises_validated plays into the update process. This is my stab at describing the history and behaviour. I welcome any corrections. The default failsafe.cf update policy is simple in nature.