Ideally Blue

Ideally Blue

Diego Zamboni  //  Computer security wonk, Mac addict without a Mac, husband, dad.

Aug 27 / 12:28am

Hierarchical copying with cfengine3

I recently posted a snippet to perform hierarchical copying in cfengine3. As I was attempting to integrate this mechanism into my copy of cfengine's COPBL, I realized that no additional functions or body components are needed. Thanks to cfengine3's list expansion, all you need to do is include in the existing copy promise the list containing the desired list of suffixes to try. For example:

Becomes:

While this looks at first sight even longer than the original (and of course, in this case you could just specify ${sys.flavour} directly in the copy_from statement), it is much more flexible. Instead of defining different sections for each class that you want to handle (e.g. suse_9, redhat_5, etc.), the same code is able to copy the corresponding binary directory for any operating system, you just have to put the corresponding bin.* directory in your repository.

Furthermore, without modifying the code, you can provide different binaries for specific hosts, for different domains, or for any other classification you want to impose. Just modify the @suffixes variable, ordering them from the most specific to the most general one:

You can do this without any additional functions, just adding ${suffixes} in the appropriate place in the copy arguments. The advantage of using a different function as in my previous post (or even better, modifying your existing copy function), is that you can add hierarchical copying without having to modify all copy promises in your policy.

Filed under  //  cfengine   tips  

Comments (0)

Aug 26 / 1:55am

The State of Open Source System Automation

The days of DIY system administration are rapidly coming to a close. Why? Because the open source tools available are just too good not to use. Presenting Bcfg2, Cfengine, Chef and Puppet.

Nice overview of the Usenix 2010 Configuration Management Summit, including descriptions and comparisons of the four major open-source CM systems.

Filed under  //  bcfg2   cfengine   chef   configurationmanagement   puppet  

Comments (0)

Aug 25 / 1:37am

cfengine Community Open Promise Body Library on GitHub

I have created a copy of the cfengine COPBL on GitHub , where I will use it as a playground for changes and additions. This is in no way endorsed by cfengine - it is just my personal copy. But if you use GitHub and want to use it, go ahead, I will try to keep it updated with respect to the original subversion repository , although it will include my changes too.

Visit the COPBL web page for more information.

Hopefully at some point the cfengine people themselves will host the COPBL at GitHub, then I should be able to remove my repository and just fork theirs.

Filed under  //  cfengine   copbl   github  

Comments (0)

Aug 24 / 2:01am

Detecting NICs that match certain IP addresses

Another cfengine snippet in case anyone finds it useful. This can be used to determine which NICs in the host have a certain IP address assigned to it, or match any pattern.

Filed under  //  cfengine  

Comments (0)

Aug 23 / 1:56am

Implementing "single-copy nirvana" in cfengine3

Here is a sample implementation in cfengine3 of the technique described in the cfengine wiki as "Singlecopy Nirvana" for cfengine2. Cfengine3 makes the technique more powerful by allowing modularization, so that you can specify both the suffixes to try, and the files to copy using those suffixes, as variables. Also, cf3's automatic list expansion allows us to write a single copy statement that will be automatically expanded into all the different values to try.

Filed under  //  cfengine  

Comments (0)

Aug 23 / 12:14am

Installing cfengine on Windows 7 under cygwin

Installing the cfengine community edition under Windows (the commercial version includes native Windows support) is fairly easy under cygwin, you just need to have the appropriate dependencies installed. Here’s how I did it.

Versions  

Additional cygwin packages needed 

To install these, run cygwin’s setup.exe, search for the packages you want, and install them.

  • make
  • gcc (will install several other packages as dependencies)
  • libdb-4.5 (possibly installed by default)
  • libdb-4.5-devel
  • openssl-devel
  • libpcre-devel
  • bison (will install m4 as a dependency, say "Yes")
  • flex

How to compile and install

  1. Unpack cfengine-3.0.5p1.tar.gz:
    tar zxvf cfengine-3.0.5p1.tar.gz
  2. cd cfengine-3.0.5p1
  3.  ./configure
  4.  make
  5. make install

That should be it. If you find any additional dependencies, please let me know (as I didn't test this on a fully clean cygwin install, I may have had already installed some other packages that are needed).

 

Filed under  //  cfengine   howto   windows  

Comments (0)

Aug 19 / 3:22pm

Grabcartoons v2.7

Last night I made a new release of my comic aggregator script, grabcartoons. You can fetch it from it brand new web page, now hosted by github.com instead of sourceforge.net.
Filed under  //  grabcartoons   software  

Comments (0)

Aug 17 / 2:36am

Installing AucTeX on EmacsW32 on Win7/64bit

Today I had to install AucTeX to use on my Win7/64 machine under EmacsW32. I found the basic instructions here: http://www.sturmnet.org/blog/2007/09/01/installing-auctex-in-emacsw32, but I had to modify them a bit (in particular, I am using tetex installed from cygwin instead of MiKTeX). Here are the commands I used:

$  mkdir -p /usr/local/share/texmf
$ ./configure --prefix='c:/Program Files (x86)/Emacs/emacs' --with-texmf-dir='/usr/local/share/texmf' --with-lispdir='c:/Program Files (x86)/Emacs/emacs/site-lisp'
$  make
$  make install

I then added the following lines to my C:\Program Files (x86)\Emacs\site-lisp\site-start.el file:

(load "auctex.el" nil t t)
(load "preview-latex.el" nil t t)
(eval-after-load 'info
       '(add-to-list 'Info-directory-list "c:/Program Files/Emacs/share/info"))
(setq TeX-auto-save t)
(setq TeX-parse-self t)

Everything seems to be working properly, even preview-mode.

Filed under  //  emacs   latex   tips   windows  

Comments (0)