Cdist

Last updated
cdist
Original author(s) Nico Schottelius, Steven Armstrong [1]
Initial release2010;13 years ago (2010)
Stable release
6.9.8 / 24 August 2021;22 months ago (2021-08-24) [2]
Repository
Written in Python, Bourne shell
Operating system Linux, Unix-like, macOS [3]
Type Software configuration management
License GNU General Public License version 3 or later
Website www.cdi.st

cdist is a free software configuration management tool for Unix-like systems. It manages nodes over SSH using the Bourne Shell, and does not require any additional software to be installed on target nodes.

Contents

Cdist differentiates itself from competing configuration management systems by choosing the Bourne Shell as the primary language for writing configuration scripts and requiring effectively no dependencies on target nodes. Although cdist's core is written in Python, an interpreter is only required on the host machine, not target nodes.

Cdist was forked in August 2022 as skonfig. [4]

Development

cdist development started in 2010 at ETH Zurich and is actively being developed [5] and is maintained primarily by Nico Schottelius and Steven Armstrong. [6] cdist is being used at various companies in Switzerland (such as ETH Zurich [7] and The OMA Browser project), [8] the US, Germany and France.

Features

cdist is a zero dependency configuration management system: It requires only ssh and a bourne-compatible shell on target hosts, which are provided by default on most Unix-like machines. [9] Because of this, cdist can be used to bootstrap other configuration management systems. [10]

Installation and configuration

cdist is not typically installed as a package (like .deb or .rpm), but rather via git. All commands are run from the created checkout. The entry point for any configuration is the shell script conf/manifest/init, which is called initial manifest in cdist terms. [11]

The main components of cdist are so called types, which bundle functionality. [12] The types essentially consists of a number of shell scripts to define which types a type reuses and which code is generated to be executed on the target host.

Architecture

cdist is split into two components:

Core

Cdist's core handles reading configuration and communicating with remote hosts. Like Ansible, cdist uses a "push" model to apply configuration changes: A cdist process on the "host" machine connects to any number of remote nodes via SSH and then performs configuration updates on those nodes. Cdist can configure multiple hosts in parallel to reduce the time spent configuring. [13]

Configuration

The configuration scripts define how the targets shall be configured. They are typically written in Bourne Shell and consists of

Shell is the de facto language for writing cdist configuration scripts, but most of the scripts can be written in any language if they contain a suitable shebang line. Shell scripting is favored because of how simple it is to access environment variables, read files, and execute system commands.

Configuration language

All user configurable parts are contained in manifests or gencode-scripts, which are shell scripts. Shell scripts were chosen, because Unix System Administrators are usually proficient in reading and writing shell scripts. Furthermore, shell is also commonly available on potential target systems, thus avoiding the need to install additional software there ("zero dependencies").

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

case"$__target_host"inmyhostname)__packagezsh--statepresent __addifnosuchline/tmp/cdist-welcome--line"Welcome to cdist";;esac

When using the types in cdist, they are called like normal programs in manifests and can make use of advanced parameter parsing as well as reading from stdin:

# Provide a default file, but let the user change it __file/home/frodo/.bashrc--source"/etc/skel/.bashrc"\--stateexists\--ownerfrodo--mode0600# Take file content from stdin __file/tmp/whatever--ownerroot--grouproot--mode644--source-<< DONEHere goes the content for /tmp/whateverDONE

Dependencies are expressed by setting up the require environment variable:

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

Access to paths and files within types is given by environment variables like $__object.

Similar software

Ansible, like cdist, uses an agentless push model to configure nodes. [9] However, Ansible requires Python for some types of targets, [15] whereas cdist does not. Ansible makes a distinction between roles, written in a declarative YAML-based language, and modules, written in Python. Cdist only has "types" which serve the purposes of both modules and roles and are mostly written in Bourne Shell. Cdist's approach might be preferable because Shell is familiar to many system administrators who have never used a configuration management system before, but Ansible's declarative language is arguably more readable and appropriate.

Related Research Articles

<span class="mw-page-title-main">Shell script</span> Script written for the shell, or command line interpreter, of an operating system

A shell script is a computer program designed to be run by a Unix shell, a command-line interpreter. The various dialects of shell scripts are considered to be scripting languages. Typical operations performed by shell scripts include file manipulation, program execution, and printing text. A script which sets up the environment, runs the program, and does any necessary cleanup or logging, is called a wrapper.

cd (command) Computer command in various operating systems

The cd command, also known as chdir, is a command-line shell command used to change the current working directory in various operating systems. It can be used in shell scripts and batch files.

In computing, a symbolic link is a file whose purpose is to point to a file or directory by specifying a path thereto.

Expect is an extension to the Tcl scripting language written by Don Libes. The program automates interactions with programs that expose a text terminal interface. Expect, originally written in 1990 for the Unix platform, has since become available for Microsoft Windows and other systems.

<span class="mw-page-title-main">Windows Registry</span> Database for Microsoft Windows

The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interfaces can all use the registry. The registry also allows access to counters for profiling system performance.

<span class="mw-page-title-main">Comparison of command shells</span>

A command shell is a command-line interface to interact with and manipulate a computer's operating system.

CANopen is a communication protocol and device profile specification for embedded systems used in automation. In terms of the OSI model, CANopen implements the layers above and including the network layer. The CANopen standard consists of an addressing scheme, several small communication protocols and an application layer defined by a device profile. The communication protocols have support for network management, device monitoring and communication between nodes, including a simple transport layer for message segmentation/desegmentation. The lower level protocol implementing the data link and physical layers is usually Controller Area Network (CAN), although devices using some other means of communication can also implement the CANopen device profile.

In computing, a shebang is the character sequence consisting of the characters number sign and exclamation mark at the beginning of a script. It is also called sharp-exclamation, sha-bang, hashbang, pound-bang, or hash-pling.

<span class="mw-page-title-main">Aptana</span> Text editor

Aptana, Inc. is a company that makes web application development tools for use with a variety of programming languages. Aptana's main products include Aptana Studio, Aptana Cloud and Aptana Jaxer.


This is a comparison of notable free and open-source configuration management software, suitable for tasks like server configuration, orchestration and infrastructure as code typically performed by a system administrator.

<span class="mw-page-title-main">Puppet (software)</span> Open source configuration management software

Puppet is a software configuration management tool which includes its own declarative language to describe system configuration. It is a model-driven solution that requires limited programming knowledge to use.

<span class="mw-page-title-main">PowerShell</span> Cross-platform command-line interface and scripting language for system and network administration

PowerShell is a task automation and configuration management program from Microsoft, consisting of a command-line shell and the associated scripting language. Initially a Windows component only, known as Windows PowerShell, it was made open-source and cross-platform on August 18, 2016, with the introduction of PowerShell Core. The former is built on the .NET Framework, the latter on .NET.

<span class="mw-page-title-main">Scripting language</span> Programming language for run-time events

A scripting language or script language is a programming language that is used to manipulate, customize, and automate the facilities of an existing system. Scripting languages are usually interpreted at runtime rather than compiled.

<span class="mw-page-title-main">Shinken (software)</span> Network monitoring software

Shinken is an open source computer system and network monitoring software application compatible with Nagios. It watches hosts and services, gathers performance data and alerts users when error conditions occur and again when the conditions clear.

<span class="mw-page-title-main">PyScripter</span>

PyScripter is a free and open-source Python integrated development environment (IDE) for Windows. It is built with Delphi's Object Pascal and Python.

The following outline is provided as an overview of and topical guide to the Perl programming language:

Ansible is a suite of software tools that enables infrastructure as code. It is open-source and the suite includes software provisioning, configuration management, and application deployment functionality.

<span class="mw-page-title-main">Nim (programming language)</span> Programming language

Nim is a general-purpose, multi-paradigm, statically typed, compiled high-level systems programming language, designed and developed by a team around Andreas Rumpf. Nim is designed to be "efficient, expressive, and elegant", supporting metaprogramming, functional, message passing, procedural, and object-oriented programming styles by providing several features such as compile time code generation, algebraic data types, a foreign function interface (FFI) with C, C++, Objective-C, and JavaScript, and supporting compiling to those same languages as intermediate representations.

References

  1. Sharma, Rishabh; Soni, Mitesh (15 March 2015). Learning Chef. Packt. pp. 10, 17–18. ISBN   978-1783285211.
  2. "Tags - cdist - Gitea: Git with a cup of tea". code.ungleich.ch. Retrieved 2022-01-15.
  3. "3. Supported operating systems — cdist 6.9.8 documentation". cdi.st. Retrieved 2022-01-15.
  4. ".github/README.md at df2f84b694afee8137b97695f6424c5aec314717 · skonfig/.github". GitHub.com.
  5. [ dead link ]
  6. "ungleich/cdist: cdist configuration management". GitHub.com. Archived from the original on 2015-07-05. Retrieved 2016-04-10.
  7. "Cdist configuration management". Archived from the original on 2013-01-15. Retrieved 2012-06-08.
  8. "About the OMA Browser". Archived from the original on August 17, 2012. Retrieved June 26, 2012.
  9. 1 2 Torberntsson, Kim; Rydin, Ylva (June 2014). A Study of Configuration Management - Systems Solutions for Deployment and Configuration of Software in a Cloud Environment (PDF) (Thesis). Uppsala University. pp. 8, 27, 31, 42. Archived (PDF) from the original on 22 November 2018.
  10. "Google Groups". Groups.google.com. Retrieved 2016-04-10.
  11. Kruse, Christian (2016). "Automatic configuration deployment with cdist". WWWTech. Archived from the original on 22 November 2018. Retrieved 22 November 2018.
  12. "cdist-type(7)". Nico.schottelius.org. Archived from the original on 2016-03-03. Retrieved 2016-04-10.
  13. Bezroukov, Nikolai. "cdist". Softpanorama. Archived from the original on 8 July 2017. Retrieved 22 November 2018.
  14. "13. Manifest — cdist 4.10.6-6-g61ac4a26 documentation". www.nico.schottelius.org. Retrieved 2019-03-26.
  15. "Installing Ansible Ansible Documentation". docs.ansible.com. Retrieved 13 January 2023. The managed node (the machine that Ansible is managing) does not require Ansible to be installed, but requires Python 2.7, or Python 3.5 - 3.11 to run Ansible library code.