2010-10-28 19:10:33 +00:00
|
|
|
## Introduction
|
2010-09-21 18:28:08 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
cdist configures your system. It is similar to
|
|
|
|
[cfengine](http://www.cfengine.org/) and [puppet](http://www.puppetlabs.com/).
|
|
|
|
It is inspired by both of those tools:
|
2010-09-21 18:28:08 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
* Try to redo the great power you get
|
|
|
|
* But leave out the bugs you also got
|
2010-09-21 18:28:08 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
And cdist is UNIX:
|
2010-09-21 18:28:08 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
It's designed to reuse existing tools,
|
|
|
|
does not require high level scripting language interpreters
|
|
|
|
and is equipped with manpages.
|
2010-09-21 18:28:08 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
### Architecture
|
2010-09-21 18:28:08 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
* KISS (keep it simple and stupid)
|
|
|
|
* Allow very easy extension of cdist (creating own types for instance)
|
|
|
|
* Push (server pushes configuration) and Pull (client retrieves config) supported
|
|
|
|
* User defines configuration in shell scripts using cdist functions
|
|
|
|
* Cdist generates internal configuration (cconfig style) and afterwards applies configuration
|
2010-09-30 20:00:42 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
## Requirements
|
2010-09-30 20:00:42 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
### Server
|
2010-09-30 20:00:42 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
* A posix like shell
|
|
|
|
* SSH-Client (for push architecture)
|
|
|
|
* SSH-Server (for pull architecture)
|
2010-09-30 20:00:42 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
### Client
|
2010-09-25 10:36:30 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
* A posix like shell
|
|
|
|
* SSH-Client (for pull architecture)
|
|
|
|
* SSH-Server (for push architecture)
|
2010-09-23 09:22:54 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
## How to get cdist
|
2010-09-23 09:22:54 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
git clone git://git.schottelius.org/cdist
|
2010-09-19 14:45:18 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
## How to install cdist
|
2010-09-19 14:45:18 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
make install
|
2010-09-19 14:45:18 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
## How to use cdist
|
2010-09-19 14:45:18 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
man cdist
|
2010-09-19 23:48:55 +00:00
|
|
|
|
2010-10-28 19:10:33 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2010-09-19 23:48:55 +00:00
|
|
|
|
|
|
|
|
|
|
|
## How cdist works
|
|
|
|
|
|
|
|
### Exploring your system
|
|
|
|
|
|
|
|
cdist analyses the system to apply the configuration on and
|
|
|
|
selects the right backends. You can use ***cdist-explore*** to
|
|
|
|
the results of the explore functions.
|
|
|
|
|
|
|
|
### Applying the configuration
|
|
|
|
|
|
|
|
cdist looks for the configuration to apply on the local host
|
|
|
|
and applies it using ***cdist-apply***.
|
|
|
|
|
|
|
|
### Managing many hosts
|
|
|
|
|
|
|
|
Whereas ***cdist-apply*** manages one host, ***cdist-deploy***
|
|
|
|
applies the configuration on enabled hosts.
|
|
|
|
|
|
|
|
## How to use cdist?
|
2010-09-16 00:20:35 +00:00
|
|
|
|
2010-09-21 18:28:08 +00:00
|
|
|
0. Create a host specification (/etc/cdist/hosts/**hostname**)
|
|
|
|
0. Add functionalilty to add
|
|
|
|
0. Run ***cdist-apply***
|
|
|
|
|
2010-09-16 00:20:35 +00:00
|
|
|
|
2010-09-19 14:45:18 +00:00
|
|
|
## What do I need [from puppet?]
|
|
|
|
|
|
|
|
### Abstraction of package managers
|
|
|
|
|
|
|
|
I don't want to care about apt, rpm, yum, pacman, etc. I just
|
|
|
|
want to ensure, some package exists or does not exist.
|
|
|
|
|
|
|
|
|
|
|
|
### Common tasks already done
|
2010-09-16 00:20:35 +00:00
|
|
|
|
2010-09-16 00:41:25 +00:00
|
|
|
- [LIBRARY] All the helper types like
|
2010-09-16 00:20:35 +00:00
|
|
|
- file
|
|
|
|
- ssh_keys
|
2010-09-16 00:36:01 +00:00
|
|
|
- package
|
|
|
|
- service
|
2010-09-16 00:41:25 +00:00
|
|
|
- user
|
2010-09-19 14:45:18 +00:00
|
|
|
|
|
|
|
### PORTABILITY
|
2010-09-16 00:41:25 +00:00
|
|
|
- [PORTABILITY] clients for every unix
|
2010-09-16 00:22:43 +00:00
|
|
|
- mostly ruby + facter in puppet
|
2010-09-19 14:45:18 +00:00
|
|
|
|
2010-09-21 18:28:08 +00:00
|
|
|
### Other
|
2010-09-19 14:45:18 +00:00
|
|
|
- Modules: Nice to put stuff together
|
|
|
|
- and reuse
|
|
|
|
- [CONDITIONS] facter is cool
|
2010-09-16 00:22:43 +00:00
|
|
|
- the DSL
|
|
|
|
- with many bugs
|
2010-09-16 00:27:41 +00:00
|
|
|
- templates
|
2010-09-19 11:52:00 +00:00
|
|
|
- Client/Server approach is nice to have
|
|
|
|
- Clients only get the part of the documentation, that's
|
|
|
|
relevant to them
|
2010-09-21 18:28:08 +00:00
|
|
|
- detect impossible/unsafe things:
|
|
|
|
- creating a file twice
|
|
|
|
- installing and removing a package
|
|
|
|
- and report location of occurence
|
|
|
|
- parse afterwards?
|
2010-09-16 00:20:35 +00:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
2010-09-19 14:45:18 +00:00
|
|
|
what is puppet? [FOR ME]
|
|
|
|
|
|
|
|
A configuration deployment assistant,
|
|
|
|
a DSL that allows you define the objectives.
|
|
|
|
A webserver with fileserver capabilities.
|
|
|
|
A client based scheduled polling infrastructure.
|
2010-10-28 19:10:33 +00:00
|
|
|
|
2010-09-19 14:45:18 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2010-09-16 00:20:35 +00:00
|
|
|
What do I miss from puppet?
|
|
|
|
|
|
|
|
- speed
|
|
|
|
- elegance
|
|
|
|
- clean design
|
|
|
|
- documentation
|
|
|
|
- the "no surprise" factor
|
|
|
|
- easy to use "data memory" (i.e. external ressources)
|
2010-09-16 00:27:41 +00:00
|
|
|
- easy integration into installation process
|
|
|
|
- copy identity to master
|
|
|
|
- multi master setups
|
|
|
|
- development configurations / tests
|
|
|
|
- editing of configuration files
|
|
|
|
- similar to cfengine
|
2010-09-16 00:41:25 +00:00
|
|
|
- replace bug squasher with bug avoidance
|
|
|
|
- qmail did not need one either
|
|
|
|
- push infrastructure
|
2010-09-23 09:22:54 +00:00
|
|
|
- real / meaningful error messages
|
|
|
|
|
2010-09-16 00:20:35 +00:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
Simple stuff done by Unix[notm]
|
|
|
|
|
2010-09-16 00:36:01 +00:00
|
|
|
- DSL: Shell!
|
|
|
|
- gives if, else and EVEN elsif for free!
|
|
|
|
- and case
|
|
|
|
- and and and
|
|
|
|
- and there's no os (solaris doesn't count) without a usable /bin/sh
|
2010-09-16 00:41:25 +00:00
|
|
|
- cdist defines what you can use
|
|
|
|
- you _can_ use os specific stuff
|
|
|
|
- but it's ugly and you shoot into your own foot
|
|
|
|
- "manifests" (use the same name here?) will be run/sourced
|
|
|
|
- inheritance possible via sourcing
|
|
|
|
- cdist-lib always preloaded
|
2010-09-19 11:52:00 +00:00
|
|
|
- library == functions?
|
2010-09-16 00:20:35 +00:00
|
|
|
- version control via git
|
|
|
|
- file distribution via ssh
|
|
|
|
- authentication via ssh
|
|
|
|
- dumb clients, similar to manifest compile in puppet
|
|
|
|
- clients just execute commands
|
2010-09-16 00:22:43 +00:00
|
|
|
- dependencies via make?
|
2010-09-19 11:52:00 +00:00
|
|
|
- how to ensure sigletons / conflicting definitions?
|
|
|
|
file { "/a":
|
|
|
|
ensure => present,
|
|
|
|
file { "/a":
|
|
|
|
ensure => absent,
|
|
|
|
- matching on explored items, not only on host name?
|
|
|
|
- match function in host? [optional]
|
|
|
|
- file source:
|
|
|
|
- relative to specification
|
|
|
|
- or absolute
|
|
|
|
|
|
|
|
|
2010-09-16 00:41:25 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2010-09-16 00:44:03 +00:00
|
|
|
Implementation
|
2010-09-16 00:41:25 +00:00
|
|
|
|
2010-09-16 00:44:03 +00:00
|
|
|
"cdist-server"
|
|
|
|
-> called by cron?
|
|
|
|
-> no need to reimplement scheduling
|
|
|
|
"cdist-explore" (facter replacement)
|
|
|
|
-> running on the client
|
2010-10-28 19:10:33 +00:00
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
Requirements:
|
|
|
|
It MUST be incredible easy/dumb to add new types.
|
|
|
|
=> growable default types
|
|
|
|
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
## TO DOC
|
|
|
|
|
|
|
|
Before initial release, document:
|
|
|
|
|
|
|
|
- how to add package backends
|
|
|
|
- how to write a minimal host manifest
|
|
|
|
- create library with all functions (and their parameters)
|
|
|
|
- cdist_package
|
|
|
|
- cdist_file
|
|
|
|
- cdist_dir
|
|
|
|
|
|
|
|
- only do necessary work
|
|
|
|
- install packages only if not existent
|
|
|
|
- copy file only if different
|
|
|
|
|
|
|
|
- how to write a module
|
|
|
|
- module function autoloading via *.sh
|
|
|
|
- module "manifest"?
|
|
|
|
- create functions in *.sh
|
|
|
|
- name functions "modulename_function"
|
|
|
|
module hellow
|
|
|
|
function kitty
|
|
|
|
=> hellow_kitty
|
|
|
|
- you are advised (not forced) to put files
|
|
|
|
to a subdirectory named "files"
|
|
|
|
|
|
|
|
|
|
|
|
|