Convert all DB config to nested

Change-Id: Iab018288f1a884a72ff687d89b68ca08df47ba06
This commit is contained in:
Yuriy Taraday 2016-10-06 15:47:13 +03:00
parent e641c7ee57
commit 0b817fce6d
5 changed files with 10 additions and 8 deletions

View File

@ -1,4 +1,6 @@
configs:
db_max_timeout: 60
db_root_password: password
mariadb_port: 3306
db:
max_timeout: 60
root_password: password
mariadb:
port: 3306

View File

@ -23,8 +23,8 @@ function bootstrap_db {
wait $(jobs -p)
}
DB_ROOT_PASSWORD="{{ db_root_password }}"
DB_MAX_TIMEOUT="{{ db_max_timeout }}"
DB_ROOT_PASSWORD="{{ db.root_password }}"
DB_MAX_TIMEOUT="{{ db.max_timeout }}"
# Only update permissions if permissions need to be updated
if [[ $(stat -c %U:%G /var/lib/mysql) != "mysql:mysql" ]]; then

View File

@ -1,6 +1,6 @@
[mysqld]
bind-address = {{ network_topology["private"]["address"] }}
port = {{ mariadb_port }}
port = {{ mariadb.port }}
datadir=/var/lib/mysql/
log-error=/var/log/ccp/mysql/mysql.log

View File

@ -1,3 +1,3 @@
#!/bin/bash -e
test -f /tmp/mariadb_ok && nc -z {{ network_topology["private"]["address"] }} {{ mariadb_port }}
test -f /tmp/mariadb_ok && nc -z {{ network_topology["private"]["address"] }} {{ mariadb.port }}

View File

@ -1,7 +1,7 @@
service:
name: mariadb
ports:
- {{ mariadb_port }}
- {{ mariadb.port }}
containers:
- name: mariadb
image: mariadb