plugins.filter.swarm packageยถ

Submodulesยถ

plugins.filter.swarm.deployed_services moduleยถ

Name the services a docker stack deploy run reported acting on.

class plugins.filter.swarm.deployed_services.FilterModuleยถ

Bases: object

filters()ยถ
plugins.filter.swarm.deployed_services.swarm_deployed_services(deploy_result: Any) โ†’ list[str]ยถ

Return the service names from a registered stack-deploy result.

Parameters:

deploy_result โ€“ the registered shell result of the deploy.

Returns:

Service names in the order the deploy reported them.

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 :N suffix is dropped because swarm carries the same idea via restart_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

filters() โ†’ dict[str, Any]ยถ
plugins.filter.swarm.restart_condition.swarm_restart_condition(value: Any) โ†’ strยถ

Translate value (a compose-style docker_restart_policy) to its swarm deploy.restart_policy.condition equivalent.

Module contentsยถ