Allow host to access the guest's db.

This commit is contained in:
Roberto Agostino Vitillo 2015-07-25 09:46:25 +01:00
Родитель dfafb65161
Коммит 11f4bb5865
3 изменённых файлов: 11 добавлений и 3 удалений

Просмотреть файл

@ -19,7 +19,7 @@
- name: stop postgres service
sudo: yes
service: name=postgresql state=stopped
service: name=postgresql state=stopped enabled=no
- name: configure postgresql
lineinfile: dest={{ansible_env.HOME}}/.bashrc regexp="^export.*postgresql" line="export PATH=/usr/lib/postgresql/{{postgresql_version}}/bin:$PATH"

Просмотреть файл

@ -14,4 +14,11 @@
lineinfile: >
dest={{ansible_env.HOME}}/.bashrc
regexp="^export SPARK_HOME"
line="export SPARK_HOME={{ansible_env.HOME}}/spark-{{spark_version}}-bin-hadoop2.4"
line="export SPARK_HOME={{ansible_env.HOME}}/spark-{{spark_version}}-bin-hadoop2.4"
- name: source pyspark
lineinfile: >
dest={{ansible_env.HOME}}/.bashrc
regexp="^export PYTHONPATH"
line="export PYTHONPATH=$SPARK_HOME/python"

Просмотреть файл

@ -46,8 +46,9 @@ trap "clean_exit" EXIT
PGSQL_DATA=`mktemp -d /tmp/PGSQL-XXXXX`
PGSQL_PATH=`pg_config --bindir`
${PGSQL_PATH}/initdb ${PGSQL_DATA}
echo "host all all 0.0.0.0/0 trust" >> $PGSQL_DATA/pg_hba.conf
mkfifo ${PGSQL_DATA}/out
${PGSQL_PATH}/postgres -F -k ${PGSQL_DATA} -D ${PGSQL_DATA} &> ${PGSQL_DATA}/out &
${PGSQL_PATH}/postgres -h '*' -F -k ${PGSQL_DATA} -D ${PGSQL_DATA} &> ${PGSQL_DATA}/out &
# Wait for PostgreSQL to start listening to connection
wait_for_line "database system is ready to accept connections" ${PGSQL_DATA}/out
export DB_TEST_URL="postgresql:///?host=${PGSQL_DATA}&dbname=template1"