UNIX cybernetics in Common Lisp.
You describe your systems (hosts) using resources having properties.
The properties are then probed and synchronized using only
/bin/sh
on the remote host, and /usr/bin/ssh
on the control host.
There is support for local shell and connection to remote hosts via ssh.
Using only /bin/sh
commands makes ksh
and bash
suitable shells as
they are compatible with /bin/sh
.
Supported resource types :
You should only allow what you would allow your system operators :
All commands issued to the remote hosts can be logged.
Does not grant the hosts access to its workstation while it works. Does not grant access to data belonging to any host. Does not send any data that is not of direct concern to the host. In short, all UNIX permissions are respected.
$ sbcl --eval '(repo:install :cl-unix-cybernetics)'
cl-unix-cybernetics
binary $ cd ~/common-lisp/thodg/cl-unix-cybernetics
$ make
$ sudo cp build/cl-unix-cybernetics /usr/local/bin/
.lisp
script
In the tutorial.lisp
file :
#!/usr/local/bin/cl-unix-cybernetics --script
(resource 'host "example.kmx.io"
:user "sysadm"
(resource 'user "sysadm"
:shell "/bin/sh"
:ensure :present))
(with-host "example.kmx.io"
(sync *host*))
$ chmod 755 tutorial.lisp
$ ./tutorial.lisp
The tutorial.lisp
script will synchronize the host “example.kmx.io”
according to the resource specifications given in the file.
#.(include "file")
In the user/dx.lisp
file :
;; Thomas de Grivel (kmx.io)
(resource 'group "dx"
:gid 19256
:ensure :present)
(resource 'user "dx"
:uid 19256
:gid 19256
:home "/home/dx"
:ensure :present)
In your main script :
#!/usr/local/bin/cl-unix-cybernetics --script
(resource 'host "example.kmx.io"
:user "admin"
(resource 'user "admin"
:shell "/bin/sh"
:ensure :present)
#.(include "user/dx"))
(with-host "example.kmx.io"
(sync *host*))
This project used to be named “Adams”. It was renamed in 2022 to “cl-unix-cybernetics”.
Thomas de Grivel thodg@kmx.io