test-nspawn: use pg_lsclusters to find the current postgres port (#54189)

This commit is contained in:
Benjamin Dauvergne 2021-05-21 11:58:14 +02:00
parent e87082983b
commit cf32fd59d3
1 changed files with 3 additions and 1 deletions

View File

@ -21,5 +21,7 @@ then
apt-key add entrouvert.gpg
apt update
/etc/init.d/postgresql start
su testuser -l -c 'cd /opt/publik-devinst; ansible-playbook -i inventory.yml -e "{postgresql_port: 5433}" install.yml'
PORT=`pg_lsclusters | tail -n1 | awk '{ print $3 }'`
echo 'cd /opt/publik-devinst; ansible-playbook -i inventory.yml -e "{postgresql_port: '$PORT'}" install.yml'
su testuser -l -c 'cd /opt/publik-devinst; ansible-playbook -i inventory.yml -e "{postgresql_port: '$PORT'}" install.yml'
fi