Allow host to access the guest's db.
This commit is contained in:
Родитель
dfafb65161
Коммит
11f4bb5865
|
@ -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"
|
||||
|
|
Загрузка…
Ссылка в новой задаче