Skip to content
Snippets Groups Projects
Readme.md 2.4 KiB
Newer Older
akame's avatar
akame committed
# oysterconf
akame's avatar
akame committed

## getting started

```sh
akame's avatar
akame committed
git clone https://gitlab.cs.fau.de/im72ywil/oysterconf ~/config/lib
akame's avatar
akame committed
```

akame's avatar
akame committed
/etc/oysterconf/conf.yml
akame's avatar
akame committed
```yml
akame's avatar
akame committed
config_root: /home/oysterconf/config/
akame's avatar
akame committed
```

~/config/param.yml
```yml
managedhost:
  domain: example.org
  manageduser:
```
akame's avatar
akame committed
user running oysterconf must be able to run `ssh manageduser@managedhost.example.org`
akame's avatar
akame committed

~/config/groups.yml
```yml
myfirstgroup:
  managedhost:
    - manageduser
```

~/data/home/manageduser/myfirstfile
```
hello world
```
~/structure/myfirstgroup/tutorial/managethatfile
```
symlink to -> ../../../data/home/manageduser/myfirstfile
```
~/structure/myfirstgroup/tutorial/55managethatfile-somecomment.frules
```
echo 'myfirstfile has been updated'
```
~structure/myfirstgroup/tutorial/55this-anothercomment.drules
```
echo 'anything in here is new'
```

akame's avatar
akame committed
`~/config/lib/oysterconf managedhost manageduser` will interactively update all managed files for this user on this host, prompting for confirmation of any changes and executing any file rules and directory rules where changes occured.
akame's avatar
akame committed

### frules
must match the name of their respective structure symlink.
```
\d\d<symlink name>-<comment>.frules
```
frules are concatenate with any other frules matching the same symlink
and any found in lib/ in alphabetical order. lib frules are responsible for checking and deploying changes. lib frules can be overridden by specifying the same two digit prefix number. shell state only persist between frules of the same structure symlink.

### drules
follow a similar naming scheme as frules.
```
\d\dthis-<comment>.drules
```
drules can be used to run code if any file referenced from this structure directory has changed. drules are concatenated in the same manner frules are. lib drules are responsible for running frules. shell state persists across all drules. drules are executed in alphabetical order of their full paths.

### templates
files ending in .tmpl inside data/, paths inside data/, frules and drules are subject to templating with the perl [template toolkit](https://template-toolkit.org). files in data can be accompanied by maps to provide template variable definitions separate from the file content.
maps must match their files name
```
_[\d\d]<filename>-comment.yml
akame's avatar
akame committed
```
maps may be shared between different templates by appropriately named symlinks. global template variables for files, paths and rules can be defined in param.yml. template tags are `'{{ '` and `' }}'`.