cdist

from Wikipedia, the free encyclopedia
cdist

Cdist logo.svg
Basic data

Maintainer Nico Schottelius, Steven Armstrong
developer unequal GmbH
Current  version 6.0.3
(October 31, 2019)
operating system Linux , Unixoide operating systems
programming language Python , bash
category Configuration management
License GPLv3
German speaking No
https://www.cdi.st/

cdist is an open-source - administration program . The main use case is the automated configuration of several computers over a network. Configuration parameters can be, for example, the installation of software , data synchronization or the execution of programs.

Cdist follows the KISS principle and controls the network elements with the help of SSH . In contrast to other configuration tools, only SSH and a POSIX -compatible shell e.g. B. Bash must be installed. So-called types describe an intended state of a network element and are written in Bash. The system uses common shell scripts and functions to express reusable descriptions. The core of the software, which manages the command sequence and the execution of code on the network elements, is written in Python .

development

The development of cdist started in 2010 around the ETH Zurich , where Schottelius and Armstrong worked as system administrators. They used configuration management systems like Puppet and encountered software design problems, so the decision was made to implement their own configuration management system.

As is usual in open source software development, communication takes place via mailing lists and IRC .

Functions

cdist is a "zero" dependency configuration management system since dependencies are already installed in Unix-like operating systems. This also makes it possible for cdist to be used to load other configuration management systems.

Installation and configuration

In contrast to the traditional installation as a package - e.g. B. .deb or .rpm - is cdist using git installed. All commands run after checking out from the software repository. The entry point for every configuration is the shell script conf / manifest / init , which is also referred to as the initial manifest in the cdist context .

The main component of cdist is called type and bundles the functionalities. They essentially consist of a number of shell scripts that define which types are used again and which code is generated in order to execute it on the target host.

architecture

cdist consists of two components

  • core
  • configuration

core

The core of cdist is implemented in Python 3 and provides the files to configure the target host. The core works in a push model : it connects from the source host to the destination host and configures the network element. SSH is used for communication and data transfer. It is possible to configure several hosts in parallel. The core uses a corresponding mode and creates child processes for each connection. This model makes it possible to scale horizontally with the available computing resources. When a certain limit has been reached and the capacity of the available CPUs has been used up, you can either add more CPUs or distribute cdist to several hosts so that more hosts can be configured in parallel.

configuration

The configuration is written in Bash and consists of

  1. the initial manifest, which describes the host and is assigned to types ,
  2. Global Explorers to collect information about the target system,
  3. Types , which provide the functionality and consist of a manifest, type explorers and gene code scripts.

Although these are all written in shell script, the order of execution in the manifests does not matter: cdist uses an idempotent configuration.

comparison

Compared to most configuration management software, cdist only needs SSH and a bash-compatible shell on a target computer. Python 3.2 is required on the source host. Since cdist is push-based, i. H. the configurations will be pushed from a server to the clients so that the clients do not ask for updates.

Configuration language

All configurable parts contain a manifest or gene code scripts written in shell script. Shell scripts were chosen because Unix system administrators are usually proficient in writing and reading shell scripts. Shell scripts are also often possible on many target systems without having to install additional software.

cdist reads its configuration from the initial manifest ( conf / manifest / init ), in which the hosts are mapped as types :

case "$__target_host" in
    myhostname)
        __package zsh --state present
        __addifnosuchline /tmp/cdist-welcome --line "Welcome to cdist"
    ;;
esac

If cdist uses types , these are called like normal programs in manifests and can make use of extended parameter parsing, as well as reading stdin :

# Provide a default file, but let the user change it
__file /home/frodo/.bashrc --source "/etc/skel/.bashrc" \
   --state exists \
   --owner frodo --mode 0600

# Take file content from stdin
__file /tmp/whatever --owner root --group root --mode 644 --source - << DONE
Here goes the content for /tmp/whatever
DONE

The require environment variable is used to express dependencies:

      __directory /tmp/foobar
      require="__directory//tmp/foobar" __file /tmp/foobar/baz

Access to paths and files within types is made through environment variables such as $__object.

See also

Web links

Individual evidence

  1. Changelog cdist 6.0.3 , accessed October 31, 2019
  2. a b cdist: Why we require Python 3.2 on the source host. Nico.schottelius.org, accessed June 14, 2017 .
  3. ^ Nico Schottelius: Migrating away from puppet to cdist. April 4, 2011. Retrieved July 12, 2017 .
  4. ^ Nico Schottelius: In puppet, $ name is not always what you expect. Retrieved July 12, 2017 .
  5. Archived copy of the mailing list. (No longer available online.) Archived from the original on November 12, 2011 ; Retrieved July 12, 2017 .
  6. Puppet bootstrap: via cdist. Groups.google.com, May 2, 2011, accessed June 14, 2017 .
  7. cdist-type (7) . Archived from the original on March 3, 2016. Retrieved April 10, 2016.