From a89fda04db77c58fdecd0356623bd54812f66113 Mon Sep 17 00:00:00 2001 From: Paul Lecuq Date: Sat, 3 Dec 2022 00:11:27 +0100 Subject: [PATCH] added docker state --- states/docker/containers.sls | 7 +++++++ states/docker/defaults.yaml | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/states/docker/containers.sls b/states/docker/containers.sls index e00e632..cb83d6c 100644 --- a/states/docker/containers.sls +++ b/states/docker/containers.sls @@ -1,6 +1,12 @@ --- {%- from "docker/map.jinja" import docker with context %} +{% for net in docker.networks -%} +docker-network-{{ net }}: + docker_network.present: + - name: {{ net }} +{% endfor -%} + {% for k, v in docker.containers.items() -%} {%- for i, j in v.items() %} {% if i == "image" -%} @@ -19,6 +25,7 @@ docker-container-{{ k }}: {%- for i, j in v.items() %} - {{ i }}: {{ j }} {%- endfor %} + - networks: {{ docker.networks }} {% endfor -%} diff --git a/states/docker/defaults.yaml b/states/docker/defaults.yaml index 521a269..c437be9 100644 --- a/states/docker/defaults.yaml +++ b/states/docker/defaults.yaml @@ -14,7 +14,6 @@ docker: config: storage-driver: overlay2 iptables: false - dns: - - 8.8.8.8 - - 8.8.4.4 + networks: + - paulbsd containers: {}