README.rst in remote-config

at master

4This project basically started out with the realization that 80 MB of Python
5modules in order to remotely manage machines is insane. Beyond that, this is
6sort of a weekend project without much structure. That said, I think the idea is
7noble and I'd like to see it develop into something more general-purpose.
9The core idea is to bring some structure to the notion of running shell scripts
10over SSH. All scripts are written in POSIX shell, and so should work on any
11operating system with ``/bin/sh``.
16As it stands today a project is executed via the ``remotecfg`` script, with the
17heavy lifting being done by a second script, which is sourced alongside the
18project scripts themselves. That second script provides functions to make things
19like installing packages and starting services idempotent. It is, however,
20currently tied to Arch Linux and Systemd.
22With the above qualifications in mind, executing a project is as easy as running
23the command line:
25``remotecfg [-s] remote_host config``
27With ``remote_host`` being the remote machine to operate on, and ``config``
28being the configuration to apply (see below). The optional ``-s`` flag indicates
29the ``remotecfg`` should use ``sudo`` to elevate its privileges to root after
30connecting to the remote host.
32Project Structure
35A project is simply a directory containing all of the files, secrets, templates,
36and remote scripts ``remotecfg`` can run. There is a directory for each of the
37aforementioned types, with each directory containing subdirectories
38corresponding to the possible configurations for that project. Everything in the
39files directory for a given configuration is copied to the remote machine and
40made available to the script in the remote directory. The secrets directory
41contains GPG encrypted files that are decrypted and then merged with the files
42directory (with the secrets directory taking precedence). The templates
43directory contains files that are run through a ``sed`` filter to replaces
44strings with secrets. The sed filter applied is specified in the first line of
45the file (this is perhaps the first thing in need of improvement).
47Sample project structure::
49 project
50 |- files
51 | |- config 1
52 | | |- file 1
53 | | |- file 2
54 | |- config 2
55 | | |- file A
56 | | |- file B
57 |- remote
58 | |- config 1
59 | |- config 2
60 |- secrets
61 | |- config 1
62 | |- config 2
63 |- templates
64 | |- config 1
65 | | |- file 3