2011-03-18 01:31:20 +00:00
|
|
|
[[!meta title="cdist - usable configuration management"]]
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
.. . .x+=:. s
|
|
|
|
dF @88> z` ^% :8
|
|
|
|
'88bu. %8P . <k .88
|
|
|
|
. '*88888bu . .@8Ned8" :888ooo
|
|
|
|
.udR88N ^"*8888N .@88u .@^%8888" -*8888888
|
|
|
|
<888'888k beWE "888L ''888E` x88: `)8b. 8888
|
|
|
|
9888 'Y" 888E 888E 888E 8888N=*8888 8888
|
|
|
|
9888 888E 888E 888E %8" R88 8888
|
|
|
|
9888 888E 888F 888E @8Wou 9% .8888Lu=
|
|
|
|
?8888u../ .888N..888 888& .888888P` ^%888*
|
|
|
|
"8888P' `"888*"" R888" ` ^"F 'Y"
|
|
|
|
"P' "" ""
|
|
|
|
|
|
|
|
|
2011-09-27 14:55:39 +00:00
|
|
|
[[!toc levels=3]]
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
## Introduction
|
|
|
|
|
2012-05-23 12:54:32 +00:00
|
|
|
cdist is a usable configuration management system. It adheres to
|
|
|
|
the KISS principle and is being used in small up to enterprise grade
|
|
|
|
environments.
|
2011-04-06 17:40:42 +00:00
|
|
|
cdist is an alternative to other configuration management systems like
|
2011-03-16 08:46:14 +00:00
|
|
|
[cfengine](http://www.cfengine.org/),
|
|
|
|
[bcfg2](http://trac.mcs.anl.gov/projects/bcfg2),
|
|
|
|
[chef](http://wiki.opscode.com/display/chef/)
|
2011-04-06 17:40:42 +00:00
|
|
|
and [puppet](http://www.puppetlabs.com/).
|
|
|
|
But cdist ticks differently, here is the feature set that makes it unique:
|
2011-04-01 23:49:52 +00:00
|
|
|
|
|
|
|
[[!table data="""
|
2011-04-01 23:50:45 +00:00
|
|
|
Keywords | Description
|
2011-04-01 23:49:52 +00:00
|
|
|
Simplicity | There is only one type to extend cdist called ***type***
|
|
|
|
Design | Type and core cleanly seperated
|
2011-04-04 07:45:25 +00:00
|
|
|
Design | Sticks completly to the KISS (keep it simple and stupid) paradigma
|
2011-04-01 23:49:52 +00:00
|
|
|
Design | Meaningful error messages - do not lose time debugging error messages
|
|
|
|
Design | Consistency in behaviour, naming and documentation
|
|
|
|
Design | No surprise factor: Only do what is obviously clear, no magic
|
|
|
|
Design | Define target state, do not focus on methods or scripts
|
2011-04-19 20:45:05 +00:00
|
|
|
Design | Push architecture: Instantly apply your changes
|
2011-04-01 23:49:52 +00:00
|
|
|
Small core | cdist's core is very small - less code, less bugs
|
|
|
|
Fast development | Focus on straightforwardness of type creation is a main development objective
|
2012-03-21 09:42:43 +00:00
|
|
|
Fast development | Batteries included: A lot of requirements can be solved using standard types
|
2011-09-13 20:07:21 +00:00
|
|
|
Modern Programming Language | cdist is written in Python
|
2011-04-01 23:49:52 +00:00
|
|
|
Requirements, Scalability | No central server needed, cdist operates in push mode and can be run from any computer
|
|
|
|
Requirements, Scalability, Upgrade | cdist only needs to be updated on the master, not on the target hosts
|
2011-04-04 07:45:25 +00:00
|
|
|
Requirements, Security | Uses well-know [SSH](http://www.openssh.com/) as transport protocol
|
|
|
|
Requirements, Simplicity | Requires only shell and SSH server on the target
|
2011-04-01 23:49:52 +00:00
|
|
|
UNIX | Reuse of existing tools like cat, find, mv, ...
|
|
|
|
UNIX, familar environment, documentation | Is available as manpages and HTML
|
|
|
|
UNIX, simplicity, familar environment | cdist is configured in POSIX shell
|
|
|
|
"""]]
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2011-03-21 12:48:40 +00:00
|
|
|
### Documentation
|
|
|
|
|
2012-01-20 16:25:33 +00:00
|
|
|
The cdist documentation is included as manpages in the distribution.
|
|
|
|
You can browse the documentation online as well:
|
2011-05-10 14:23:59 +00:00
|
|
|
|
2012-01-20 16:25:33 +00:00
|
|
|
* [latest version](man/latest)
|
|
|
|
* [all versions (>= 2.0.4)](man)
|
2011-03-21 12:48:40 +00:00
|
|
|
|
2011-03-16 10:08:12 +00:00
|
|
|
### OS support
|
|
|
|
|
|
|
|
cdist was tested or is know to run on at least
|
|
|
|
|
|
|
|
* [Archlinux](http://www.archlinux.org/)
|
|
|
|
* [Debian](http://www.debian.org/)
|
2012-01-06 12:17:16 +00:00
|
|
|
* [CentOS](http://www.centos.org/)
|
2011-04-02 00:20:19 +00:00
|
|
|
* [Fedora](http://fedoraproject.org/)
|
2011-03-16 10:08:12 +00:00
|
|
|
* [Gentoo](http://www.gentoo.org/)
|
|
|
|
* [Mac OS X](http://www.apple.com/macosx/)
|
2011-03-25 21:28:34 +00:00
|
|
|
* [OpenBSD](http://www.openbsd.org)
|
2011-03-16 10:20:18 +00:00
|
|
|
* [Redhat](http://www.redhat.com/)
|
2011-03-16 10:08:12 +00:00
|
|
|
* [Ubuntu](http://www.ubuntu.com/)
|
2012-01-06 12:17:16 +00:00
|
|
|
* [XenServer](http://www.citrix.com/xenserver/)
|
2011-03-16 10:08:12 +00:00
|
|
|
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
## Requirements
|
|
|
|
|
|
|
|
### Server
|
|
|
|
|
|
|
|
* A posix like shell
|
2011-09-13 20:07:21 +00:00
|
|
|
* Python (>= 3.2 required)
|
2012-01-17 23:31:18 +00:00
|
|
|
* SSH client
|
2011-09-26 07:24:49 +00:00
|
|
|
* Asciidoc (for building the manpages)
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
### Client ("target host")
|
|
|
|
|
|
|
|
* A posix like shell
|
2012-01-17 23:31:18 +00:00
|
|
|
* SSH server
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
|
2011-09-27 14:53:02 +00:00
|
|
|
## Installation
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2012-02-11 10:53:40 +00:00
|
|
|
### Preparation
|
2011-09-27 14:53:02 +00:00
|
|
|
|
2012-01-09 09:01:44 +00:00
|
|
|
Ensure you have Python 3.2 installed on the machine you use to **deploy to the targets**
|
|
|
|
(the ***source host***).
|
2011-09-27 14:53:02 +00:00
|
|
|
|
2011-09-27 15:31:39 +00:00
|
|
|
#### Archlinux
|
|
|
|
|
|
|
|
Archlinux already has python >= 3.2, so you only need to do:
|
|
|
|
|
|
|
|
pacman -S python
|
|
|
|
|
2012-06-28 12:05:44 +00:00
|
|
|
#### CentOS
|
|
|
|
|
|
|
|
See the "From source" section
|
|
|
|
|
2011-09-27 14:53:02 +00:00
|
|
|
#### Debian
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2012-01-09 09:01:44 +00:00
|
|
|
For Debian >= wheezy:
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2012-01-09 09:01:44 +00:00
|
|
|
aptitude install python3
|
|
|
|
|
2012-05-24 13:45:20 +00:00
|
|
|
On squeeze you can add following line in **/etc/apt/sources.list**
|
|
|
|
|
|
|
|
deb http://ftp.debian.org/debian wheezy main
|
|
|
|
|
2012-05-24 13:50:31 +00:00
|
|
|
And add pinning entry in **/etc/apt/preferences.d/wheezy**:
|
2012-05-24 13:45:20 +00:00
|
|
|
|
|
|
|
Package: *
|
|
|
|
Pin: release n=wheezy
|
|
|
|
Pin-Priority: 1
|
|
|
|
|
|
|
|
Please be aware that both **openssh-server** and **openssh-client** might be
|
2012-05-24 13:50:31 +00:00
|
|
|
removed on **python3.2** installation. You surely want to reinstall them:
|
2012-05-24 13:45:20 +00:00
|
|
|
|
|
|
|
apt-get install -t wheezy openssh-server openssh-client
|
|
|
|
|
2012-05-24 13:50:31 +00:00
|
|
|
For older Debian versions, installing python 3.2 manually is required.
|
|
|
|
|
|
|
|
|
2012-01-09 09:01:44 +00:00
|
|
|
#### Fedora
|
|
|
|
|
|
|
|
For Fedora >= 15:
|
|
|
|
|
|
|
|
yum install python3
|
|
|
|
|
|
|
|
#### FreeBSD
|
|
|
|
|
|
|
|
For the port:
|
|
|
|
|
|
|
|
cd /usr/ports/lang/python32/ && make install clean
|
|
|
|
|
|
|
|
For the package:
|
|
|
|
|
|
|
|
pkg_add -r python32
|
2011-09-27 14:53:02 +00:00
|
|
|
|
2011-10-01 11:08:07 +00:00
|
|
|
#### Gentoo
|
|
|
|
|
|
|
|
Gentoo only provides python 3.2 in testing packages (http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=3&chap=3).
|
|
|
|
If you want to ensure nothing breaks you must set back the python version to what was default before.
|
|
|
|
|
|
|
|
emerge -av =python-3.2.2 --autounmask-write
|
|
|
|
emerge -av =python-3.2.2
|
|
|
|
eselect python list
|
|
|
|
eselect python list set python3.2
|
|
|
|
|
2011-10-01 12:02:45 +00:00
|
|
|
#### Max OS X
|
|
|
|
|
2012-01-20 15:33:50 +00:00
|
|
|
You can choose between Homebrew and Macports, either way works:
|
|
|
|
|
|
|
|
[Homebrew](http://mxcl.github.com/homebrew/) variant:
|
|
|
|
|
|
|
|
brew install python3
|
|
|
|
|
|
|
|
[Macports](http://www.macports.org/install.php) variant:
|
2011-10-01 12:02:45 +00:00
|
|
|
|
|
|
|
port install python32
|
2011-10-01 12:46:41 +00:00
|
|
|
ln -s /opt/local/bin/python3.2 /opt/local/bin/python3
|
2011-10-01 12:02:45 +00:00
|
|
|
|
2012-06-28 12:05:44 +00:00
|
|
|
#### From Source
|
|
|
|
|
|
|
|
For those operating systems not yet support Python 3.2:
|
|
|
|
|
|
|
|
pyversion=3.2.3
|
|
|
|
wget http://www.python.org/ftp/python/$pyversion/Python-${pyversion}.tar.bz2
|
|
|
|
tar xvfj Python-${pyversion}.tar.bz2
|
|
|
|
cd Python-${pyversion}
|
|
|
|
./configure
|
|
|
|
make
|
|
|
|
sudo make install
|
|
|
|
|
|
|
|
This installs python 3.2 to /usr/local/bin. Ensure this directory is in
|
|
|
|
your PATH environment variable.
|
|
|
|
|
|
|
|
|
2011-09-27 14:53:02 +00:00
|
|
|
### Get cdist
|
|
|
|
|
|
|
|
You can clone cdist from git, which gives you the advantage of having
|
|
|
|
a version control in place for development of your own stuff as well.
|
2011-03-16 08:46:14 +00:00
|
|
|
To install cdist, execute the following commands:
|
|
|
|
|
|
|
|
git clone git://git.schottelius.org/cdist
|
|
|
|
cd cdist
|
|
|
|
export PATH=$PATH:$(pwd -P)/bin
|
|
|
|
|
2011-09-26 07:26:58 +00:00
|
|
|
# If you want the manpages
|
2011-11-17 14:30:21 +00:00
|
|
|
./build man
|
2011-03-16 08:46:14 +00:00
|
|
|
export MANPATH=$MANPATH:$(pwd -P)/doc/man
|
|
|
|
|
|
|
|
|
|
|
|
### Available versions
|
|
|
|
|
2011-03-16 09:44:43 +00:00
|
|
|
There are at least the following branches available:
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2011-07-26 18:26:13 +00:00
|
|
|
* Development: master
|
2012-01-17 23:31:18 +00:00
|
|
|
* 2.0: Python rewrite of cdist core [stable branch]
|
2011-03-16 12:03:29 +00:00
|
|
|
|
|
|
|
Old versions:
|
|
|
|
|
2011-09-13 20:07:21 +00:00
|
|
|
* 1.7: Bugfixes, cleanups, new type and explorer rename
|
2011-05-10 13:50:18 +00:00
|
|
|
* 1.6: New types, cleaned up \_\_package* types, internal cleanup
|
2011-04-05 14:49:09 +00:00
|
|
|
* 1.5: Focus on object orientation instead of global stage orientation
|
2011-03-29 14:47:02 +00:00
|
|
|
* 1.4: Support for redefiniton of objects (if equal)
|
2011-03-24 12:30:08 +00:00
|
|
|
* 1.3: Support for local and remote code execution (current stable)
|
2011-03-19 23:02:44 +00:00
|
|
|
* 1.2: Dependencies supported
|
2011-04-05 14:49:09 +00:00
|
|
|
* 1.1: \_\_file to \_\_file, \_\_directory, \_\_link migration
|
2011-03-24 12:30:08 +00:00
|
|
|
* 1.0: First official release
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2011-03-16 09:44:43 +00:00
|
|
|
Other branches may be available for features or bugfixes, but they
|
2011-03-16 08:46:14 +00:00
|
|
|
may vanish at any point. To select a specific branch use
|
|
|
|
|
|
|
|
# Generic code
|
|
|
|
git checkout -b <name> origin/<name>
|
|
|
|
|
2011-03-21 07:59:04 +00:00
|
|
|
# Stay on a specific version
|
2011-09-13 20:07:21 +00:00
|
|
|
version=2.0
|
2011-03-29 14:49:49 +00:00
|
|
|
git checkout -b $version origin/$version
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2011-03-16 10:38:05 +00:00
|
|
|
### Mirrors
|
|
|
|
|
2011-03-16 10:55:17 +00:00
|
|
|
* git://github.com/telmich/cdist.git ([github](https://github.com/telmich/cdist))
|
2011-10-16 14:20:35 +00:00
|
|
|
* git://git.code.sf.net/p/cdist/code ([sourceforge](https://sourceforge.net/p/cdist/code))
|
2011-03-16 10:38:05 +00:00
|
|
|
|
2011-03-16 09:44:43 +00:00
|
|
|
## Update
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
To upgrade cdist in the current branch use
|
|
|
|
|
|
|
|
git pull
|
|
|
|
|
|
|
|
# Also update the manpages
|
2011-11-17 14:30:21 +00:00
|
|
|
./build man
|
2011-03-16 08:46:14 +00:00
|
|
|
export MANPATH=$MANPATH:$(pwd -P)/doc/man
|
|
|
|
|
2011-03-16 09:44:43 +00:00
|
|
|
If you stay on a version branche (i.e. 1.0, 1.1., ...), nothing should break.
|
|
|
|
The master branch on the other hand is the development branch and may not be
|
|
|
|
working, break your setup or eat the tree in your garden.
|
|
|
|
|
2011-09-13 20:07:21 +00:00
|
|
|
### Upgrading from 1.7 to 2.0
|
|
|
|
|
2011-09-13 20:23:28 +00:00
|
|
|
* Ensure python (>= 3.2) is installed on the server
|
|
|
|
* Use "cdist config host" instead of "cdist-deploy-to host"
|
|
|
|
* Use "cdist config -p host1 host2" instead of "cdist-mass-deploy"
|
2011-09-13 20:40:10 +00:00
|
|
|
* Use "cdist banner" for fun
|
2011-09-13 20:23:28 +00:00
|
|
|
* Use **\_\_object_fq** instead of **\_\_self** in manifests
|
|
|
|
|
2011-05-10 13:50:18 +00:00
|
|
|
### Upgrading from 1.6 to 1.7
|
|
|
|
|
|
|
|
* If you used the global explorer **hardware_type**, you need to change
|
|
|
|
your code to use **machine** instead.
|
|
|
|
|
2011-04-05 14:49:09 +00:00
|
|
|
### Upgrading from 1.5 to 1.6
|
|
|
|
|
|
|
|
* If you used **\_\_package_apt --preseed**, you need to use the new
|
|
|
|
type **\_\_debconf_set_selections** instead.
|
|
|
|
* The **\_\_package** types accepted either --state deinstalled or
|
|
|
|
--state uninstaaled. Starting with 1.6, it was made consistently
|
|
|
|
to --state removed.
|
|
|
|
|
2011-04-01 08:03:43 +00:00
|
|
|
### Upgrading from 1.3 to 1.5
|
2011-03-24 12:30:08 +00:00
|
|
|
|
|
|
|
No incompatiblities.
|
|
|
|
|
2011-03-21 12:48:40 +00:00
|
|
|
### Upgrading from 1.2 to 1.3
|
|
|
|
|
|
|
|
Rename **gencode** of every type to **gencode-remote**.
|
|
|
|
|
2011-03-19 02:05:22 +00:00
|
|
|
### Upgrading from 1.1 to 1.2
|
|
|
|
|
|
|
|
No incompatiblities.
|
|
|
|
|
2011-03-16 09:44:43 +00:00
|
|
|
### Upgrading from 1.0 to 1.1
|
|
|
|
|
2011-03-16 09:48:43 +00:00
|
|
|
In 1.1 the type **\_\_file** was split into **\_\_directory**, **\_\_file** and
|
|
|
|
**\_\_link**. The parameter **--type** was removed from **\_\_file**. Thus you
|
|
|
|
need to replace **\_\_file** calls in your manifests:
|
2011-03-16 09:44:43 +00:00
|
|
|
|
2011-03-16 09:48:43 +00:00
|
|
|
* Remove --type from all \_\_file calls
|
|
|
|
* If type was symlink, use \_\_link and --type symbolic
|
|
|
|
* If type was directory, use \_\_directory
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
## Support
|
|
|
|
|
|
|
|
### IRC
|
|
|
|
|
|
|
|
You can join the development ***IRC channel***
|
2012-05-14 15:00:02 +00:00
|
|
|
[#cstar on irc.freenode.net](irc://irc.freenode.org/#cstar).
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
### Mailing list
|
|
|
|
|
|
|
|
Bug reports, questions, patches, etc. should be send to the
|
|
|
|
[cdist mailing list](http://l.schottelius.org/mailman/listinfo/cdist).
|
|
|
|
|
2012-01-09 23:00:23 +00:00
|
|
|
### Linkedin
|
|
|
|
|
|
|
|
If you have an account
|
|
|
|
at [Linked in](http://www.linkedin.com/),
|
|
|
|
you can join the
|
|
|
|
[cdist group](http://www.linkedin.com/groups/cdist-configuration-management-3952797).
|
|
|
|
|
2011-04-19 22:14:18 +00:00
|
|
|
### Commercial support
|
2011-03-21 23:43:44 +00:00
|
|
|
|
|
|
|
You can request commercial support for cdist from
|
|
|
|
[my company](http://firma.schottelius.org/english/).
|
|
|
|
|
2011-03-16 08:46:14 +00:00
|
|
|
## Used by
|
|
|
|
|
|
|
|
If you're using cdist, feel free to send a report to the mailing list.
|
|
|
|
Interesting information are for instance
|
|
|
|
|
|
|
|
* Which services do you manage?
|
|
|
|
* How many machines do you manage?
|
|
|
|
* What are the pros/cons you see in cdist?
|
|
|
|
* General comments/critics
|
|
|
|
|
2012-04-21 23:20:44 +00:00
|
|
|
### Nico Schottelius, Systems Group ETH Zurich, local.ch and privately
|
2011-03-16 08:46:14 +00:00
|
|
|
|
|
|
|
Yes, I'm actually eating my own dogfood and currently managing
|
|
|
|
|
|
|
|
* [plone](http://plone.org/) (cms)
|
|
|
|
* [moinmoin](http://moinmo.in/) (wiki)
|
|
|
|
* [apache](http://httpd.apache.org/) (webserver)
|
|
|
|
* [kerberos (mit)](http://web.mit.edu/kerberos/) (authentication)
|
2011-04-07 09:57:50 +00:00
|
|
|
* [nss-pam-ldapd](http://arthurdejong.org/nss-pam-ldapd/) (authentication)
|
2011-03-16 08:46:14 +00:00
|
|
|
* [ircd-hybrid](http://www.ircd-hybrid.org/) (chat)
|
|
|
|
* [stunnel](http://stunnel.mirt.net/) (SSL tunnel)
|
2011-03-16 09:57:16 +00:00
|
|
|
* [mercurial-server](http://www.lshift.net/mercurial-server.html) (version control)
|
|
|
|
* [xfce](http://www.xfce.org/) (lightweight desktop environment)
|
|
|
|
* [slim](http://slim.berlios.de/) (graphical login manager for X11)
|
2011-03-16 08:46:14 +00:00
|
|
|
|
2011-04-07 09:57:50 +00:00
|
|
|
with cdist on more than **60** production machines of the
|
2011-03-16 08:46:14 +00:00
|
|
|
[Systems Group](http://www.systems.ethz.ch) at the
|
2011-03-22 11:37:32 +00:00
|
|
|
[ETH Zurich](http://www.ethz.ch) as well at home.
|
2011-03-21 16:24:09 +00:00
|
|
|
|
|
|
|
### Steven Armstrong, CBRG ETH Zurich
|
|
|
|
|
|
|
|
The CBRG is managing most of their compute clusters with cdist.
|
|
|
|
|
|
|
|
|