mirror of
https://github.com/Security-Onion-Solutions/securityonion.git
synced 2026-07-14 12:53:09 +02:00
clear stale docker network endpoints before starting containers
docker_container.running fails with an address-already-in-use error when a container holds a stale sobridge endpoint - either after its IP changes in pillar or after an unclean shutdown leaves the endpoint behind. Add the clear_stale_endpoint macro and call it from every enabled.sls whose container attaches to sobridge with a static IP. The macro force-disconnects the container from the network only when its current endpoint IP does not match the one salt is about to assign, so it is a no-op on a normal highstate. The strelka states use state IDs that differ from their container names, so those calls pass state_id explicitly. nginx resolves its IP through container_config, which varies by role.
This commit is contained in:
@@ -8,6 +8,9 @@
|
||||
{% from 'vars/globals.map.jinja' import GLOBALS %}
|
||||
{% from 'docker/docker.map.jinja' import DOCKERMERGED %}
|
||||
{% set SO_POSTGRES_USER = salt['pillar.get']('postgres:auth:users:so_postgres_user:user', 'so_postgres') %}
|
||||
{% from 'docker/macros/docker_endpoint.jinja' import clear_stale_endpoint %}
|
||||
|
||||
{{ clear_stale_endpoint('so-postgres', 'sobridge', DOCKERMERGED.containers['so-postgres'].ip) }}
|
||||
|
||||
include:
|
||||
- postgres.auth
|
||||
|
||||
Reference in New Issue
Block a user