diff options
| author | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-12-08 17:17:53 -0700 |
|---|---|---|
| committer | Carlos Konstanski <ckonstanski@pippiandcarlos.com> | 2017-12-08 17:17:53 -0700 |
| commit | cfa920431bd31ac2e619e32b672f41cfd382ecf5 (patch) | |
| tree | 9f59137e080b219f00c251d92d28b79875444551 /salt/openbook/ci/files/openbookctl | |
| parent | 924140c06b24e7c981bdc9c2c5c24cac3cb05a45 (diff) | |
Add support to build the database only
Issue: IS-37
Diffstat (limited to 'salt/openbook/ci/files/openbookctl')
| -rw-r--r-- | salt/openbook/ci/files/openbookctl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/salt/openbook/ci/files/openbookctl b/salt/openbook/ci/files/openbookctl index 6a8aa5e..0296882 100644 --- a/salt/openbook/ci/files/openbookctl +++ b/salt/openbook/ci/files/openbookctl @@ -9,7 +9,7 @@ wait_for_database() { echo "Waiting for database to start..." started=1 for i in {120..0}; do - if echo 'SELECT 1' | mysql -h 127.0.0.1 -u root --password='{% raw %}{{ openbook_database_password }}{% endraw %}' &>/dev/null; then + if echo 'SELECT 1' | mysql -h {% raw %}{{ ansible_default_ipv4.address }}{% endraw %} -u root --password='{% raw %}{{ openbook_database_password }}{% endraw %}' &>/dev/null; then started=0 break fi @@ -22,9 +22,9 @@ wait_for_database() { } ensure_openbook_databases_created() { - if ! echo "SHOW DATABASES;" | mysql -h 127.0.0.1 -u root --password='{% raw %}{{ openbook_database_password }}{% endraw %}' 2>/dev/null | fgrep 'openbook'; then + if ! echo "SHOW DATABASES;" | mysql -h {% raw %}{{ ansible_default_ipv4.address }}{% endraw %} -u root --password='{% raw %}{{ openbook_database_password }}{% endraw %}' 2>/dev/null | fgrep 'openbook'; then echo "Creating Openbook schema..." - mysql -h 127.0.0.1 -u root --password='{% raw %}{{ openbook_database_password }}{% endraw %}' &>/dev/null < {{ pillar["database"]["files"]["create_openbook_schemas"]["path"] }}/{{ pillar["database"]["files"]["create_openbook_schemas"]["name"] }} + mysql -h {% raw %}{{ ansible_default_ipv4.address }}{% endraw %} -u root --password='{% raw %}{{ openbook_database_password }}{% endraw %}' &>/dev/null < {{ pillar["database"]["files"]["create_openbook_schemas"]["path"] }}/{{ pillar["database"]["files"]["create_openbook_schemas"]["name"] }} fi } {% raw %}{% endif %}{% endraw %} |
