1
0
Fork 0
mirror of synced 2024-05-26 20:11:11 -04:00

Autogenerate yadm.md after new jinja functionality

This commit is contained in:
Jan Schulz 2017-03-25 19:31:46 +01:00
parent a479b70d8a
commit ca849b50de

43
yadm.md
View file

@ -50,11 +50,12 @@
The config command is not passed directly through. Instead use The config command is not passed directly through. Instead use
the gitconfig command (see below). the gitconfig command (see below).
alt Create symbolic links for any managed files matching the naming alt Create symbolic links and process jinja templates for any man-
rules describe in the ALTERNATES section. It is usually unnec- aged files matching the naming rules describe in the ALTERNATES
essary to run this command, as yadm automatically processes section. It is usually unnecessary to run this command, as yadm
alternates by default. This automatic behavior can be disabled automatically processes alternates by default. This automatic
by setting the configuration yadm.auto-alt to "false". behavior can be disabled by setting the configuration yadm.auto-
alt to "false".
bootstrap bootstrap
Execute $HOME/.yadm/bootstrap if it exists. Execute $HOME/.yadm/bootstrap if it exists.
@ -320,6 +321,38 @@
ridden using the configuration options local.os, local.hostname, and ridden using the configuration options local.os, local.hostname, and
local.user. local.user.
If envtpl ( pip install envtpl ) is available, you can also create
jinja templates (http://jinja.pocoo.org/) which will transformed into
real files. yadm will treat files ending in
##yadm_tmpl
as jinja templates. During processing, the following variables are set
according to the above rules:
YADM_CLASS
YADM_OS
YADM_HOSTNAME
YADM_USER
E.g. a file 'whatever##yadm_tmpl' with the following content
{% if YADM_USER == 'harvey' -%}
config={{YADM_CLASS}}-{{ YADM_OS }}
{% else -%}
config=dev-whatever
{% endif -%}
would output a file with the follwing content, if the username would be
'harvey'
config=work-Linux
and the following otherwise:
config=dev-whatever
## ENCRYPTION ## ENCRYPTION
It can be useful to manage confidential files, like SSH or GPG keys, It can be useful to manage confidential files, like SSH or GPG keys,