Add support for swarm mode templating Upstream-commit: 8ffd1a370c447db92a67d17f900ccd453dbcedee Component: engine