| 1 |
{{db-spam}} |
| 2 |
{{Infobox software |
| 3 |
|name = cdist |
| 4 |
|logo = |
| 5 |
|screenshot = |
| 6 |
|caption = |
| 7 |
|collapsible = |
| 8 |
|author = Nico Schottelius, Steven Armstrong |
| 9 |
|developer = |
| 10 |
|released = 2010 |
| 11 |
|latest release version = 2.0.13 |
| 12 |
|latest release date = 05-Jun-2012 |
| 13 |
|frequently updated = |
| 14 |
|programming language = [[Python_(programming_language)|Python]], [[Bourne shell]] |
| 15 |
|operating system = [[GNU/Linux]], [[Unix-like]] |
| 16 |
|platform = |
| 17 |
|size = |
| 18 |
|language = |
| 19 |
|status = |
| 20 |
|genre = [[Configuration management]] |
| 21 |
|license = [[GPLv3]]. |
| 22 |
|website = http://www.nico.schottelius.org/software/cdist/ |
| 23 |
}} |
| 24 |
|
| 25 |
'''cdist''' is a configuration management system, which adheres to the [[KISS_principle]]. It is being used in small up to enterprise grade environments. |
| 26 |
cdist is an alternative to other configuration management systems [[CFEngine]], [[Bcfg2]], [[Chef (software)|Chef]] and [[Puppet (software)|Puppet]]. |
| 27 |
cdist development started in 2010 at [[ETH Zurich]] and is actively being developed by a lot of [[FOSS]] contributors |
| 28 |
and maintained by the two main developers Nico Schottelius and |
| 29 |
Steven Armstrong. cdist is being watched on github by more than 100 people and has more than 30 forks.<ref>cdist development at https://github.com/telmich/cdist</ref> |
| 30 |
The major part of the discussion about cdist happens on the mailinglist<ref>cdist mailinglist http://l.schottelius.org/mailman/listinfo/cdist</ref> |
| 31 |
and on the IRC channel #cstar in the [[Freenode]] network. cdist is being used at various companies in Switzerland (for instance at [[ETH Zurich]]), the USA, Germany and France. |
| 32 |
|
| 33 |
|
| 34 |
Its core is written in [[Python (programming language)|Python]] and the types are |
| 35 |
written in [[Bourne Shell]]. Cdist is released under the [[GNU General Public License|GPL]]. |
| 36 |
cdist has been a no. 1 topic on [[Hacker News]] for some time.<ref>cdist on [[Hacker News]] https://news.ycombinator.com/item?id=3422678</ref> |
| 37 |
|
| 38 |
|
| 39 |
== Architecture == |
| 40 |
|
| 41 |
cdist is split into two components: |
| 42 |
|
| 43 |
* The core |
| 44 |
* The configuration |
| 45 |
|
| 46 |
=== Core === |
| 47 |
|
| 48 |
The core of cdist is implemented in Python 3 and provides the executables to configure target hosts. The core operates in a push model: It connects |
| 49 |
from the source host '''to''' the target hosts and configures the machines. For communication and file transfer [[SSH]] is being used. |
| 50 |
To allow parallel configuration of hosts, the core supports a parallel mode in which it creates a child process for every connection. |
| 51 |
This model allows cdist to scale horizontally with the available computing resources: If at a certain limit is reached and the capacity of the |
| 52 |
available CPUs has been used, adding another CPU or distributing cdist to multiple hosts allows to configure more hosts in parallel. |
| 53 |
|
| 54 |
=== Configuration === |
| 55 |
|
| 56 |
The configuration is written in [[Bourne Shell]] and consists of |
| 57 |
|
| 58 |
* The initial manifest (which defines which host is assigned which types) |
| 59 |
* Global Explorers (to gain information about the target system) |
| 60 |
* Types (which provide all functionality and consist of a manifest, type explorers and gencode scripts) |
| 61 |
|
| 62 |
Although all of these are written in Shell script, the order of execution in the manifests does not matter: cdist employs a idempotent |
| 63 |
configuration. |
| 64 |
|
| 65 |
=== Comparison === |
| 66 |
|
| 67 |
In comparison to most other configuration management software, cdist does not have any requirements on the target host besides SSH and a bourne shell. |
| 68 |
It requires Python 3.2 on the source host, though.<ref>Why cdist requires Python 3.2 on the source host - http://www.nico.schottelius.org/blog/cdist-python-3.2-requirement/</ref> |
| 69 |
cdist operates in push based approach, in which a server pushes configurations to the client and the clients do not poll for updates. |
| 70 |
|
| 71 |
== Configuration DSL == |
| 72 |
|
| 73 |
All user configurable parts are contained in manifests or gencode-scripts, which are shell scripts. |
| 74 |
Shell scripts were chosen, because Unix System Administrators are usually profound in reading |
| 75 |
and writing shell scripts. |
| 76 |
|
| 77 |
cdist reads its configuration from the initial manifest ('''conf/manifest/init'''), in which hosts are mapped to |
| 78 |
types: |
| 79 |
|
| 80 |
<pre> |
| 81 |
case "$__target_host" in |
| 82 |
myhostname) |
| 83 |
__package zsh --state present |
| 84 |
__addifnosuchline /tmp/cdist-welcome --line "Welcome to cdist" |
| 85 |
;; |
| 86 |
esac |
| 87 |
</pre> |
| 88 |
|
| 89 |
When using the types in cdist, they are called like normal programs in manifests and can make use of |
| 90 |
advanced parameter parsing as well as reading from stdin: |
| 91 |
|
| 92 |
<pre> |
| 93 |
# Provide a default file, but let the user change it |
| 94 |
__file /home/frodo/.bashrc --source "/etc/skel/.bashrc" \ |
| 95 |
--state exists \ |
| 96 |
--owner frodo --mode 0600 |
| 97 |
|
| 98 |
# Take file content from stdin |
| 99 |
__file /tmp/whatever --owner root --group root --mode 644 --source - << DONE |
| 100 |
Here goes the content for /tmp/whatever |
| 101 |
DONE |
| 102 |
</pre> |
| 103 |
|
| 104 |
Dependencies are expressed by setting up the '''require''' environment variable: |
| 105 |
<pre> |
| 106 |
__directory /tmp/foobar |
| 107 |
require="__directory//tmp/foobar" __file /tmp/foobar/baz |
| 108 |
</pre> |
| 109 |
|
| 110 |
Access to paths and files within types is given by environment variables like $__object. |
| 111 |
|
| 112 |
|
| 113 |
== See also == |
| 114 |
{{Portal|Free software}} |
| 115 |
* [[Comparison of open source configuration management software]] |
| 116 |
|
| 117 |
== References == |
| 118 |
{{reflist}} |
| 119 |
|
| 120 |
== External links == |
| 121 |
* [http://www.nico.schottelius.org/software/cdist/ cdist Website] |
| 122 |
* [https://github.com/telmich/cdist Github home] |
| 123 |
* [http://l.schottelius.org/mailman/listinfo/cdist cdist mailinglist] |
| 124 |
* [https://freecode.com/projects/cdist cdist on freecode] |
| 125 |
|
| 126 |
|
| 127 |
[[Category:Configuration management]] |
| 128 |
[[Category:Free software programmed in Python]] |
| 129 |
[[Category:2010 software]] |
| 130 |
[[Category:Linux configuration utilities]] |
| 131 |
[[Category:Mac OS X]] |
| 132 |
[[Category:Linux package management-related software]] |
| 133 |
[[Category:Unix package management-related software]] |
| 134 |
|