plugins.filter.swarm packageยถ
Submodulesยถ
plugins.filter.swarm.deployed_services moduleยถ
Name the services a docker stack deploy run reported acting on.
plugins.filter.swarm.restart_condition moduleยถ
Filter swarm_restart_condition: map a compose-style
docker_restart_policy to swarmโs deploy.restart_policy.condition.
docker stack deploy does NOT understand composeโs restart: keys
(no, always, unless-stopped, on-failure[:N]). It uses a
disjoint set of condition: values: none, on-failure, any.
Translating between the two used to be inline Jinja in
roles/sys-svc-container/templates/deploy.yml.j2 โ this filter
pulls it out so the call site reads as a single expression and is
unit-testable.
MAPPINGยถ
'no'->'none'One-shot containers (matomo bootstrap, erpnext configurator, shopware init). They exit 0 and must never be respawned.
'on-failure'or'on-failure:N'->'on-failure'Respawn only on non-zero exit. Swarm has no separate max-restarts knob on the condition itself; the
:Nsuffix is dropped because swarm carries the same idea viarestart_policy.max_attempts.'always'/'unless-stopped'->'any'Long-running services โ the historical default of this deploy template.
- anything else (None, empty, typo) ->
'any'Safe default: long-running services are the most common case and a typo in a roleโs docker_restart_policy would otherwise silently produce
none, which would skip respawning real services and look like a deploy success.
- class plugins.filter.swarm.restart_condition.FilterModuleยถ
Bases:
object