add robustness after testing site.yml

This commit is contained in:
Egon Rijpkema
2017-08-02 15:22:10 +02:00
parent d907ec4969
commit 4db6499419
6 changed files with 29 additions and 22 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 --rm -i mariadb:10.1.22 mysql -uroot -pgeheim --host "$1" << EOF
docker run --rm -i mariadb:10.2 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

@ -27,6 +27,13 @@
- name: Initialize db
script: scripts/initialize_db.sh {{ hostvars[groups['databases'][0]]['ansible_default_ipv4']['address'] }}
register: result
until: result|succeeded
# sometimes the initial connect fails.
# Retry until it succeeds.
retries: 7
delay: 3
ignore_errors: yes
- name: keystone manage commands to setup db
command: >