diff --git a/bootstrap/playbooks/postgres.yaml b/bootstrap/playbooks/postgres.yaml index 6b09b9f8..696d5a96 100644 --- a/bootstrap/playbooks/postgres.yaml +++ b/bootstrap/playbooks/postgres.yaml @@ -8,9 +8,14 @@ POSTGRES_USER: solar POSTGRES_PASSWORD: solar POSTGRES_DATABASE: solar -- wait_for: host=127.0.0.1 port=5432 timeout=15 delay=1 -- shell: docker exec vagrant_pg_1 gosu postgres psql -c "DROP DATABASE solar;" -- shell: docker exec vagrant_pg_1 gosu postgres psql -c "CREATE DATABASE solar WITH owner=postgres LC_COLLATE='C' TEMPLATE template0;" +- name: Waiting for postgresql in container + shell: docker exec vagrant_pg_1 psql -h localhost -U solar -c "SELECT NOW();" + register: result + until: result.rc == 0 + retries: 15 + delay: 1 +- shell: docker exec vagrant_pg_1 psql -h localhost -U solar postgres -c "DROP DATABASE solar;" +- shell: docker exec vagrant_pg_1 psql -h localhost -U solar postgres -c "CREATE DATABASE solar WITH owner=postgres LC_COLLATE='C' TEMPLATE template0;" - lineinfile: dest: /.solar_config_override line: "solar_db: postgresql://solar:solar@127.0.0.1:5432/solar" diff --git a/bootstrap/playbooks/solar.yaml b/bootstrap/playbooks/solar.yaml index 1ce685f8..3bd25e71 100644 --- a/bootstrap/playbooks/solar.yaml +++ b/bootstrap/playbooks/solar.yaml @@ -1,6 +1,6 @@ --- -- hosts: all +- hosts: localhost sudo: yes vars: ssh_ip_mask: "10.*.*.*" @@ -12,7 +12,7 @@ - shell: pip install git+git://github.com/Mirantis/solar-agent.git - include: tasks/ssh_conf.yaml -- hosts: all +- hosts: localhost tasks: # setup solar-resources # change to openstack/solar-resources later diff --git a/utils/jenkins/run.sh b/utils/jenkins/run.sh index e8b2d13a..197de3fb 100755 --- a/utils/jenkins/run.sh +++ b/utils/jenkins/run.sh @@ -65,13 +65,9 @@ set -e # wait for riak -if [ $SOLAR_DB_BACKEND == "riak" ] +if [ ${SOLAR_DB_BACKEND} == "riak" ] then sudo docker exec vagrant_riak_1 riak-admin wait_for_service riak_kv; -elif [ $SOLAR_DB_BACKEND == "postgres" ] -then - # TODO: Should be replaced with something smarter - sleep 5 fi export SOLAR_CONFIG_OVERRIDE="/.solar_config_override"