Page MenuHomeDevCentral

D1669.id4256.diff
No OneTemporary

D1669.id4256.diff

diff --git a/pillar/paas/docker.sls b/pillar/paas/docker.sls
--- a/pillar/paas/docker.sls
+++ b/pillar/paas/docker.sls
@@ -19,7 +19,6 @@
- certbot/certbot
dwellers:
# Core services
- - nasqueron/mysql
- nasqueron/rabbitmq
# Infrastructure and development services
- nasqueron/aphlict
@@ -28,6 +27,8 @@
- nasqueron/notifications
- nasqueron/phabricator
equatower:
+ # Core services
+ - nasqueron/mysql
# Continuous deployment jobs
- jenkinsci/jenkins
- nasqueron/jenkins-slave-php
@@ -36,6 +37,11 @@
docker_containers:
equatower:
+ # MySQL
+ mysql:
+ acquisitariat: {}
+ phpbb_db: {}
+
# CD
jenkins:
host: cd.nasqueron.org
@@ -47,7 +53,7 @@
ip: 172.17.0.101
# phpBB SaaS
- phpbb_db: {}
+ # The SaaS uses a MySQL instance, declared in the MySQL section.
# Openfire
openfire:
diff --git a/roles/paas-docker/containers/phpbb_db.sls b/roles/paas-docker/containers/mysql.sls
rename from roles/paas-docker/containers/phpbb_db.sls
rename to roles/paas-docker/containers/mysql.sls
--- a/roles/paas-docker/containers/phpbb_db.sls
+++ b/roles/paas-docker/containers/mysql.sls
@@ -7,37 +7,42 @@
# -------------------------------------------------------------
{% set has_selinux = salt['grains.get']('selinux:enabled', False) %}
+{% set containers = pillar['docker_containers'][grains['id']] %}
+
+{% for instance in containers['mysql'] %}
# -------------------------------------------------------------
# Home directory
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-/srv/phpbb/mysql:
+/srv/{{ instance }}/mysql:
file.directory:
- user: 999
- group: 999
- makedirs: True
{% if has_selinux %}
-selinux_context_phpbb_mysql_data:
+selinux_context_{{ instance }}_mysql_data:
selinux.fcontext_policy_present:
- - name: /srv/phpbb/mysql
+ - name: /srv/{{ instance }}/mysql
- sel_type: svirt_sandbox_file_t
-selinux_context_phpbb_mysql_data_applied:
+selinux_context_{{ instance }}_mysql_data_applied:
selinux.fcontext_policy_applied:
- - name: /srv/phpbb/mysql
+ - name: /srv/{{ instance }}/mysql
{% endif %}
# -------------------------------------------------------------
# Container
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-phpbb_db:
+{{ instance }}:
docker_container.running:
- detach: True
- interactive: True
- image: nasqueron/mysql
- - binds: /srv/phpbb/mysql:/var/lib/mysql
+ - binds: /srv/{{ instance }}/mysql:/var/lib/mysql
- environment:
MYSQL_ROOT_PASSWORD: {{ salt['random.get_str'](31) }}
+
+{% endfor %}

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 15:09 (20 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2308028
Default Alt Text
D1669.id4256.diff (2 KB)

Event Timeline