Page MenuHomeDevCentral

D1725.id4388.diff
No OneTemporary

D1725.id4388.diff

diff --git a/pillar/paas/docker.sls b/pillar/paas/docker.sls
--- a/pillar/paas/docker.sls
+++ b/pillar/paas/docker.sls
@@ -40,6 +40,17 @@
# phpBB SaaS
- nasqueron/mysql
+# -------------------------------------------------------------
+# Networks
+#
+# Containers can be grouped by network, instead to use links.
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+docker_networks:
+ equatower:
+ cd:
+ subnet: 172.18.1.0/24
+
# -------------------------------------------------------------
# Containers
#
diff --git a/roles/paas-docker/docker/init.sls b/roles/paas-docker/docker/init.sls
--- a/roles/paas-docker/docker/init.sls
+++ b/roles/paas-docker/docker/init.sls
@@ -8,3 +8,4 @@
include:
- .software
+ - .networks
diff --git a/roles/paas-docker/docker/network.sls b/roles/paas-docker/docker/network.sls
new file mode 100644
--- /dev/null
+++ b/roles/paas-docker/docker/network.sls
@@ -0,0 +1,23 @@
+# -------------------------------------------------------------
+# Salt — Provision Docker engine
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+# Project: Nasqueron
+# Created: 2018-09-11
+# License: Trivial work, not eligible to copyright
+# -------------------------------------------------------------
+
+{% set networks = pillar['docker_networks'][grains['id']] %}
+
+# -------------------------------------------------------------
+# Bridge networks
+# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+{% for network, args in networks.items() %}
+
+docker_network_{{ network }}:
+ docker_network.present:
+ - name: {{ network }}
+ - driver: bridge
+ - subnet: {{ args['subnet'] }}
+
+{% endfor %}

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 13:28 (19 h, 42 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2314012
Default Alt Text
D1725.id4388.diff (1 KB)

Event Timeline