/README
1 cfgfoo
2 Copyright 2018, 2019 Vasilii Kolobkov
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <https://www.gnu.org/licenses/>.
16
17
18 cfgfoo is a simple configuration management recipe - write shell scripts
19 to bring the system into a desired state, transfer and execute via ssh
20 if necessary. Proved feasible for running a single server and believed
21 to scale reasonably well up to a handful more.
22
23 A quick primer:
24
25 $ git clone https://orangeshoelaces.net/git/cfgfoo.git
26 $ mkdir config
27 $ cat > config/foo <<END
28 listen on egress
29 END
30 $ cat > setup <<END
31 #!/bin/sh
32 set -e
33 . ./cfgfoo/aliases
34
35 fs_install {./config,/etc}/foo
36 eddit_appendfln /etc/bar 'include "/etc/foo"'
37 rc_start bazd
38 END
39 $ chmod 0700 setup
40 $ cat > upload <<END
41 tar chzf cfg.tgz cfgfoo config setup
42 scp cfg.tgz 'root@example.net:~'
43 rm cfg.tgz
44 END
45 $ chmod 0700 upload
46 $ cat > rsetup <<END
47 #!/bin/sh
48 ssh root@example.net 'nohup ~/setup'
49 END
50 $ ./upload && ./rsetup
51
52 Configuration script comprise steps. Latter being made of two shell
53 functions 'step_taken' and 'take_step' driven by a cfgfoo script. As the
54 names suggest, they are to be idempotent. Steps for some basic operations
55 are included and you can add your own easily.