judo
judo copied to clipboard
Default env vars for hosts/groups
It should be possible to specify some default env var values per each host, or group of hosts.
Currently env vars can be specified on the command line for each run:
judo -e ANSWER=42 -c 'echo $ANSWER' localhost
However this doesn't scale well if different host groups need different values:
judo -e ANSWER=42 -c 'echo $ANSWER' hitchhikers
judo -e ANSWER=47 -c 'echo $ANSWER' trekkies
In addition to all the error-prone repetition, it fails to take advantage of concurrent execution between the two groups.
Perhaps we could use an envdir-like scheme, where per-host and/or per-group directories can reside under an env
hierarchy:
env/
hitchhikers/
ANSWER
trekkies/
ANSWER
$ cat env/hitchhikers/ANSWER
42
This would also require for hosts to actually track which groups they belong to; there is groups []string
in host definition but it's currently not populated. It's also a bit of a trap, since a host can only know that it's a part of a group, if the group has been explicitly targeted on the command line.