Movatterモバイル変換


[0]ホーム

URL:


Jump to content
WikipediaThe Free Encyclopedia
Search

cdist

From Wikipedia, the free encyclopedia
Software configuration management tool
This article has multiple issues. Please helpimprove it or discuss these issues on thetalk page.(Learn how and when to remove these messages)
The topic of this articlemay not meet Wikipedia'snotability guidelines for products and services. Please help to demonstrate the notability of the topic by citingreliable secondary sources that areindependent of the topic and provide significant coverage of it beyond a mere trivial mention. If notability cannot be shown, the article is likely to bemerged,redirected, ordeleted.
Find sources: "Cdist" – news ·newspapers ·books ·scholar ·JSTOR
(June 2012) (Learn how and when to remove this message)
icon
This articleneeds additional citations forverification. Please helpimprove this article byadding citations to reliable sources. Unsourced material may be challenged and removed.
Find sources: "Cdist" – news ·newspapers ·books ·scholar ·JSTOR
(June 2012) (Learn how and when to remove this message)
This articlemay be too technical for most readers to understand. Pleasehelp improve it tomake it understandable to non-experts, without removing the technical details.(June 2012) (Learn how and when to remove this message)
(Learn how and when to remove this message)
cdist
Original authorsNico Schottelius, Steven Armstrong[1]
Initial release2010; 15 years ago (2010)
Stable release
6.9.8 / 24 August 2021; 4 years ago (2021-08-24)[2]
Repository
Written inPython,Bourne shell
Operating systemLinux,Unix-like,macOS[3]
TypeSoftware configuration management
LicenseGNU General Public License version 3 or later
Websitewww.cdi.st

cdist is afreesoftware configuration management tool forUnix-like systems. It managesnodes overSSH using theBourne Shell, and does not require any additional software to be installed on target nodes.

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 inPython, an interpreter is only required on the host machine, not target nodes.

Cdist wasforked in August 2022 asskonfig.[4]

Development

[edit]

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

Features

[edit]

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 mostUnix-like machines.[9] Because of this, cdist can be used to bootstrap other configuration management systems.[10]

Installation and configuration

[edit]

cdist is not typically installed as a package (like .deb or .rpm), but rather viagit.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 typereuses and which code is generated to be executed on the target host.

Architecture

[edit]

cdist is split into two components:

  • The core
  • The configuration scripts

Core

[edit]

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

[edit]

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

  • The initial manifest, anentry point where all configuration runs begin. This script typically uses information about the target node, such as its hostname and operating system, to call other, more specific scripts which perform the actual configuration.
  • Global Explorers, small scripts which glean information about the target system (such as operating system, init system, and hostname)
  • Types, which describe reusable chunks of configuration. Types are instantiated in manifests and are the only way to actually run code on the target machines. The name "type" is meant as an analog to "class" in an object-oriented language, because a type can be turned into multiple "objects" depending on what parameters are passed to it.[14] For instance, the__file type can be turned into multiple "objects", each one representing the creation of a certain file. Ansible's "roles" are the equivalent of cdist's types. Types can have many components:
    • Object ID: When a type is turned into an object, it is passed a unique object ID. The same type cannot be instantiated twice with the same ID. This ID is not random like a UUID, but rather is some unique identifier that is meaningful in relation to the type. For example, the__file type's ID is the absolute path to the file.
    • Parameters: Many types cannot be fully described by the object ID, and take additional information in the form of parameters. The__file type takes agroup parameter which specifies to which Unix group should own the file.
    • Explorers: In addition to the global explorers described above, types sometimes have their own explorers that collect type-specific information from the remote machine. The__file type uses explorers to determine whether the file being created already exists. It sometimes uses this information to skip creation of the file.
    • Manifest: A type manifest can instantiate other types, making code re-use easy.
    • Gencode Scripts: Thegencode-remote script is the main way to actually update the configuration of target nodes.gencode-remote runs on the local machine, but itsstandard output is sent to the remote machine and executed as a shell script. There is also a less frequently usedgencode-local script which outputs code to be run locally.

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

Configuration language

[edit]

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 readingand 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 totypes:

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 ofadvanced 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 therequire 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

[edit]

Ansible, like cdist, uses an agentless push model to configure nodes.[9] However, Ansible requiresPython 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.

References

[edit]
  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. Retrieved2022-01-15.
  3. ^"3. Supported operating systems — cdist 6.9.8 documentation".cdi.st. Retrieved2022-01-15.
  4. ^".github/README.md at df2f84b694afee8137b97695f6424c5aec314717 · skonfig/.github".GitHub.com.
  5. ^[1][dead link]
  6. ^"ungleich/cdist: cdist configuration management".GitHub.com.Archived from the original on 2015-07-05. Retrieved2016-04-10.
  7. ^"Cdist configuration management". Archived fromthe original on 2013-01-15. Retrieved2012-06-08.
  8. ^"About the OMA Browser". Archived fromthe original on August 17, 2012. RetrievedJune 26, 2012.
  9. ^abTorberntsson, 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. Retrieved2016-04-10.
  11. ^Kruse, Christian (2016)."Automatic configuration deployment with cdist".WWWTech.Archived from the original on 22 November 2018. Retrieved22 November 2018.
  12. ^"cdist-type(7)".Nico.schottelius.org. Archived fromthe original on 2016-03-03. Retrieved2016-04-10.
  13. ^Bezroukov, Nikolai."cdist".Softpanorama.Archived from the original on 8 July 2017. Retrieved22 November 2018.
  14. ^"13. Manifest — cdist 4.10.6-6-g61ac4a26 documentation".www.nico.schottelius.org. Retrieved2019-03-26.
  15. ^"Installing Ansible — Ansible Documentation".docs.ansible.com. Retrieved13 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.

External links

[edit]
Retrieved from "https://en.wikipedia.org/w/index.php?title=Cdist&oldid=1266934396"
Categories:
Hidden categories:

[8]ページ先頭

©2009-2025 Movatter.jp