CFEngine Design Center

The Design Center is a public repository for customizable CFEngine design patterns and code. Here you can download finished solutions to use and adapt them for your environment, or find examples that inspire you to develop new patterns. Design Center will become an increasingly important way of working with CFEngine, a place for infrastructure engineers to share and re-use knowledge and expertise.

Browse Sketches

Design Center Elements

The CFEngine Design Center contains three main types of content:

  • Sketches are ready-to-use components (e.g. collections of bundles, support files, etc.) that can be directly imported and used in CFEngine policies. Most sketches are specialized for achieving specific tasks, or for maintaining a specific piece of software, however their scope and capabilities can be varied. They are organized in categories according to their functionality. Sketches are managed (installed, configured, enabled and uninstalled) through a specialized tool called cf-sketch.
  • CFEngine policy examples, whose objective is to provide starting points for executing complex tasks in CFEngine. They are in most cases not ready to use and will require customization and modification before using them in your own environment.
  • Tools that help in miscellaneous aspects of managing or interacting with CFEngine.


What can I do with the CFEngine Design Center?

Whether you are just getting started with CFEngine or are a veteran writing CFEngine policies, the Design Center has something for you.

For beginners, the Design Center allows you to quickly get started with the implementation of a CFEngine infrastructure, without touching a single line of CFEngine code. The sketches available from the DC have been carefully reviewed and tested to guarantee that they will perform their task as indicated. Using sketches, you can, for example:

  • Install and configure MySQL on a Linux server, using the db_mysql sketch.
  • Install and configure Wordpress on a Linux server, using the wordpress sketch.
  • Configure sshd on a Unix server, using the ssh sketch.
  • Configure DNS Settings, the local hosts table, or the system clock timezone using the config_resolver, etc_hosts or tzconfig sketches, respectively.

The cf-sketch tool installs the sketches, configures their parameters, and enables them for execution, all through a command-line interface so that you do not have to learn the CFEngine policy language and still benefit from the power of CFEngine for managing your infrastructure. Additionally, the code for all the sketches is publicly available on github, and is an excellent resource for learning new techniques once you decide to learn the policy language.

If you are an advanced CFEngine user, you will find in the Design Center many components for managing complex tasks. The use of these sketches will allow you to greatly simplify your policies, while retaining full control over the parameters used, and may even allow you to do a few complex things that you had not implemented yet.

Using the cf-sketch tool, you can easily set class expressions which control where each sketch will be executed, and with which parameters. You can activate each sketch more than once with different parameters, so you can easily perform the same task under different situations. Of course, you can also invoke sketches directly from your policies by calling the appropriate bundles yourself, thus giving you the ultimate flexibility in how sketches are integrated into your environment.

In addition, you have probably accumulated over time a good number of useful CFEngine bundles and body definitions, and techniques for performing useful tasks. We encourage you to contribute back to the Design Center, so that more people can benefit from your experience and knowledge.


What's next?

We invite you to:

If you have any comments, please let us know by sending email to design-center[at]