made ip of db host dynamic.

This commit is contained in:
Egon Rijpkema 2017-06-14 10:58:38 +02:00
parent ac78a1a272
commit c17c6388a7
2 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
# Start a mariadb container to use its mysql client to initialize the keystone database.
docker run -i mariadb:10.1.22 mysql -uroot -pgeheim --host 172.23.38.125 << EOF
docker run -i mariadb:10.1.22 mysql -uroot -pgeheim --host "$1" << EOF
CREATE DATABASE IF NOT EXISTS keystone;
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'localhost' IDENTIFIED BY 'keystone';
GRANT ALL PRIVILEGES ON keystone.* TO 'keystone'@'%' IDENTIFIED BY 'keystone';

View File

@ -38,7 +38,7 @@
state: started
- name: Initialize db
script: scripts/initialize_db.sh
script: scripts/initialize_db.sh {{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
- name: keystone manage commands to setup db
command: >