Sometimes you may want many similar program configurations. It'd be great if you could use "inheritance", like so
[program:foo-base]
; ... options ...
abstract = true
[program:foo1]
parent = foo-base
[program:foo2]
parent = foo-base
or like this
[program-template:foo-base]
; ... options ...
[program:foo1]
template = foo-base
This came up on the mailing list a while back. In that discussion, a couple of users said that they were using other tools to generate their Supervisor configuration files. I prefer that approach over putting something like this into the core of Supervisor. It should also be fairly trivial to roll your own config file generator with something like Jinja and doing that would give you much more flexibility (variables, looping, conditionals, etc).
Good point -- but auto-generated configuration files can get very tedious to maintain unless you always use your generator for everything, which implies that your generator must support every feature of supervisord (otherwise you can't use autogeneration and thus have to manually edit your files).
Of course you could roll out your own supervisord config manager but that's a ridiculous waste of time compared to the time required to implement templating into supervisord.
In most cases customizable default values for [program:x] settings would do the trick.
Another approach would be to enable [program:x] settings to be defined in a [group:x] as default values for the programs of the group.
I agree that managing configuration files externally with templates feels like too much hassle for most use cases of Supervisor.
Is there any way to do this within the configs yet?
Inheriting from group doesn't work either yet :(
+1 for inheriting from a group
+1 for inheriting from from groups/program wildcard definitions!
Most helpful comment
Is there any way to do this within the configs yet?
Inheriting from group doesn't work either yet :(