+ All Categories
Home > Technology > Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World...

Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World...

Date post: 17-May-2015
Category:
Upload: normation
View: 4,459 times
Download: 0 times
Share this document with a friend
Description:
With the advent of virtualization and cloud computing, modern IT management relies more and more on the concept of "create, set up, use and throw away" servers. In this context, the benefits of automating and rationalizing the "set up phase" are obvious. This is where configuration management tools come in to play. This presentation kicks off with a discussion of some key points of configuration management and their benefits and drawbacks, building on real world examples (well, pseudo examples, mostly too silly to have ever really happened... or maybe not?) The main contender will then be introduced: CFEngine 3. Released in 2009, this is a brand new version of the open source configuration management solution, built on 17+ years of experience from previous versions of the software. We'll introduce the technology's key points, comparing approaches with similar devops-type tools, such as Puppet and Chef (where possible). I then cover the basics of setting up a minimal environment to start automating your configuration with CFEngine 3, and simple but illustrative examples.
Popular Tags:
35
 Configuration Management Automating and rationalizing server setup with CFEngine 3 Jonathan Clarke <[email protected]> 24/09/2011
Transcript
Page 1: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Configuration ManagementAutomating and rationalizing server setup with CFEngine 3

Jonathan Clarke <[email protected]>

24/09/2011

Page 2: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

About the speaker

Jonathan Clarke

Sysadmin background

Infrastructure management

FLOSS contributor:CFEngine

Others (OpenLDAP, LSC, FusionInventory...)

Startup created in 2010

Based in Paris

Configuration management:

CFEngine (partner)

Rudder (creator)

→ CTO →

Page 3: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Introduction

1. CREATE

2. SETUP

3. USE

4. THROW AWAYCloud Computing

Page 4: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Introduction

Cloud Computing

→ APIs and tools are available

1. CREATE

2. SETUP

3. USE

4. THROW AWAY

Page 5: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Introduction

Cloud Computing

Three approaches:

1. Manually

2. Imaging

3. Configuration tool

1. CREATE

2. SETUP

3. USE

4. THROW AWAY

Page 6: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

1) Configuration Management principles

2) Configuration Management tools

3) About CFEngine 3

4) Getting started

Agenda

Page 7: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Configuration Management

Principles through examples...

Page 8: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

A server crashed.

Install a new one, peoplecan't work without it!

OK, it'll be done inabout two days...

There's a new critical security patchwe must deploy on all our servers!

Get it out quickly!

Right, I'll put the wholeteam on it.

Why configuration management?

Page 9: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Why configuration management?

Automation

IndustrializationReproducibility

Page 10: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Why configuration management?

How do we setupservice X?

Ask Jim, he'sthe expert on that.

But he left the company...

Huh, this server has been loggingerrors for a few weeks.

Oh? I think Michael changedsomething on it recently...He'll tell you what it was.

Damn, he's on vacation!

Page 11: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Why configuration management?

Building-upknowledge

HistoryDocumentation

Page 12: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Why configuration management?

An intruder just stole our datausing a vulnerability in amodule we don't need...

I thought the project specificationensured that we disabled that?

Er, it did, but we enabled it tosolve a problem and forgot todisable it afterwards... sorry...

Page 13: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Why configuration management?

Continuousvigilance

AlertsAutomatic repairs

Page 14: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Why configuration management?

I don't understand how thisserver is setup. It doesn't matchour best-practices.

Oh, that's a legacy server...

Well, it's a collection of littlethings, here and there...

Give me details on ourcurrent security policy.

Ah... Well, OK.Tell me: is it fully appliedon all our critical servers?

Er...

Page 15: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Why configuration management?

Rationalization

ControlNormalization

Page 16: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Configuration management benefits

Rationalization

ControlNormalization

Continuousvigilance

AlertsAutomatic repairs

Building-upknowledge

HistoryDocumentation

Automation

IndustrializationReproducibility

Page 17: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

The tools

Configuration Management

Page 18: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Main tools available

CFEngine 3 Puppet Chef

Page 19: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Main tools available: history

Source:http://verticalsysadmin.com/blog/uncategorized/relative-origins-of-cfengine-chef-and-puppet

Relative origins of CFEngine, Puppet and Chef

Page 20: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

The tools: similaritiesCFEngine 3 Puppet Chef

Text-based / CLIinterface

Client-server model(sometimes optional) Open Source

Designed specificallyfor configuration

management

Common origins

Page 21: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

The tools: some differencesPuppet ChefCFEngine 3

C Ruby RubyLanguage

Windows supportYes Preliminary Partial

GPL Apache(ex-GPL)

ApacheLicense

Page 22: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

A bit about CFEngine 3...

Page 23: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: FeaturesMulti platform

Windows support

Two versions:

1. Community (open source)Runs in Cygwin

2. Nova (commercial)● Native Windows service

Page 24: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Features

Adapted toheterogeneousenvironments

Multi-OSMulti-distribution

Make it ”transparent” (forget about the complexity)

Existing standard library handling the differences between each OS and distribution

Page 25: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Features

Lightweight, non-intrusive

Daemon consumption on managed hostsNon-intrusive

Only two dependencies:- BerkeleyDB- OpenSSL

Page 26: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Features

Highly scalableEvolution of CPU utilization

for an increasing number of managed hosts

From 25 to 400 clients (x16)CPU utilization increases by 1.16%

Notes:• Each host runs CFEngine every 5 minutes• Configuration tested sets up Apache web server• Tests and monitoring using AWS

Page 27: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Features

Lightweight, non-intrusive

AutonomousFault-tolerant

Multi platform

Adapted toheterogeneousenvironments

Highly scalable

Progressiveroll-out

Page 28: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Getting started with CFEngine 3

Page 29: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Installing Install from sources:

http://www.cfengine.com/source_code

Prebuilt packages: Debian / SuSE / Fedora / RHEL / Ubuntu Requires free signup https://cfengine.com/inside/myspace

Page 30: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Client-Server Using a server is optional!

Get started by running standalone

CFEngine's server daemon is cf-serverd Dedicated protocol: TCP port 5308 Requires SSL key exchange

Page 31: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Configuration Minimal configuration:

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

bundle agent HelloWorld{ # This will output "Hello World!" commands: "/bin/echo Hello World!";}

Syntax notes

Whitespace doesn't countComments follow #

Structure notes

● Structures are created using { }● Structures are bundles or bodies

Page 32: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Configuration Promise types:

Special types(all versions)

vars

classes

methods

reports

Promise types(all versions)

files

packages

processes

commands

storage

interfaces (for future use)

Promise types(commercial versions)

environments

services

databases

Special types(commercial versions)

outputs

Page 33: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Examples Install and update the LAMP stack

bundle agent lamp {  vars:

"packages" slist => { "httpd", "php5", "mysql" };

  packages:    "${packages}"      package_method => generic,      package_method => "addupdate";}

Page 34: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

CFEngine 3: Examples

packages:debian::

"apache2"package_policy => "add",package_method => apt;

centos|redhat::"httpd"

package_policy => "add",package_method => yum;

Install Apache with distribution variations

Page 35: Configuration management: automating and rationalizing server setup with CFEngine 3 (Open World Forum 2011)

  

Thanks for participating!

Jonathan ClarkeEmail: [email protected]: jooooooon42

24/09/2011

Stay in touch...


Recommended