Project

General

Profile

How to configure servers with cdist » History » Version 3

Timothée Floure, 02/16/2021 04:22 PM

1 1 Nico Schottelius
h1. How to configure servers with cdist
2
3
h2. Introduction
4
5 2 Timothée Floure
We are using "cdist":https://www.nico.schottelius.org/software/cdist/ to manage our system configurations. This software has originally been developped by ungleich-folk, but now has a much broader community.
6
7
h2. The ungleich cdist environment
8
9
Our environment is composed of 4 repositories:
10
11 3 Timothée Floure
* "ungleich-intern/cdist-workdir":https://code.ungleich.ch/ungleich-intern/cdist-workdir: meta-repository used as convenience helper to run access types across our 3 type repositories.
12
* "ungleich-intern/dot-cdist":https://code.ungleich.ch/ungleich-intern/dot-cdist: internal (= private) and historic cdist repository. Contains our manifests.
13
* "ungleich-public/cdist-ungleich":https://code.ungleich.ch/ungleich-public/cdist-ungleich: public (infrastructure transparency, sharing with the community) ungleich types that are too specific to be upstream to core cdist or cdist-contrib.
14
* "ungleich-public/cdist-contrib":https://code.ungleich.ch/ungleich-public/cdist-contrib: community-managed repository for types that do not fit into core-cdist.
15 1 Nico Schottelius
16
h2. Applying changes to servers
17
18 3 Timothée Floure
Initial setup:
19 1 Nico Schottelius
20 3 Timothée Floure
* Clone "ungleich-intern/cdist-workdir":https://code.ungleich.ch/ungleich-intern/cdist-workdir
21
* Install ''myrepos'' and - within cdist-workdir - run ''mr update''.
22
* Set your ''CDIST_PATH'', using - for example - the ''cdist.cfg'' file in cdist-workdir.
23
24
Day-to-day workflow, within cdist-workdir:
25
26
* Make sure you have the latest configuration/types with ''mr update''.
27
* Configure the target host with ''cdist config -vv <hostname>''.
28
29
h3. Using the control node
30
31
You can use the control node to run cdist when you're using an unreliable connection (in a train, far away in Korea, etc.). Note that you will have to forward your SSH agent with the ''-A'' ssh flag.
32
33 1 Nico Schottelius
<pre>
34
# Login to configuration server
35
ssh -A ungleich@control.ungleich.ch
36
37
# Ensure cdist configuration is up-to-date
38 3 Timothée Floure
cd cdist-workdir
39
mr update
40 1 Nico Schottelius
41
# Configure
42
cdist config -vv <hostname>
43
</pre>