* debian/pg_createconfig_patroni: Determine Patroni API port dynamically and
add @API_PORT@ substitution. * debian/config.yml.in: Replace API port by @API_PORT@.
This commit is contained in:
parent
88f6008c75
commit
73515105b2
3
debian/changelog
vendored
3
debian/changelog
vendored
|
@ -3,6 +3,9 @@ patroni (1.5.4-6) UNRELEASED; urgency=medium
|
||||||
[ Michael Banck ]
|
[ Michael Banck ]
|
||||||
* debian/tests/acceptance: Fix DCS check for zookeeper in case etcd-server is
|
* debian/tests/acceptance: Fix DCS check for zookeeper in case etcd-server is
|
||||||
installed as well.
|
installed as well.
|
||||||
|
* debian/pg_createconfig_patroni: Determine Patroni API port dynamically and
|
||||||
|
add @API_PORT@ substitution.
|
||||||
|
* debian/config.yml.in: Replace API port by @API_PORT@.
|
||||||
|
|
||||||
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Mon, 04 Feb 2019 12:15:43 +0100
|
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Mon, 04 Feb 2019 12:15:43 +0100
|
||||||
|
|
||||||
|
|
4
debian/config.yml.in
vendored
4
debian/config.yml.in
vendored
|
@ -5,8 +5,8 @@ name: @HOSTNAME@
|
||||||
@DCS_CONFIG@
|
@DCS_CONFIG@
|
||||||
|
|
||||||
restapi:
|
restapi:
|
||||||
listen: @HOSTIP@:8008
|
listen: @HOSTIP@:@API_PORT@
|
||||||
connect_address: @HOSTIP@:8008
|
connect_address: @HOSTIP@:@API_PORT@
|
||||||
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
# certfile: /etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||||
# keyfile: /etc/ssl/private/ssl-cert-snakeoil.key
|
# keyfile: /etc/ssl/private/ssl-cert-snakeoil.key
|
||||||
# authentication:
|
# authentication:
|
||||||
|
|
5
debian/pg_createconfig_patroni
vendored
5
debian/pg_createconfig_patroni
vendored
|
@ -46,6 +46,10 @@ else
|
||||||
pg_lsclusters | awk '{print $3}' | grep -q $PORT && echo "Port $PORT already in use" && exit 1
|
pg_lsclusters | awk '{print $3}' | grep -q $PORT && echo "Port $PORT already in use" && exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# determine API port (default is 8008) by incrementing for each additional
|
||||||
|
# Postgres port. 2576 is 8008 - 5432.
|
||||||
|
API_PORT=$((2576+$PORT))
|
||||||
|
|
||||||
# support both '-' and '/' as separator
|
# support both '-' and '/' as separator
|
||||||
if [ $(echo $SCOPE | grep -- -) ]
|
if [ $(echo $SCOPE | grep -- -) ]
|
||||||
then
|
then
|
||||||
|
@ -96,6 +100,7 @@ cat /etc/patroni/config.yml.in | \
|
||||||
-e "s/@HOSTNAME@/${HOSTNAME}/g" \
|
-e "s/@HOSTNAME@/${HOSTNAME}/g" \
|
||||||
-e "s/@HOSTIP@/${HOSTIP}/g" \
|
-e "s/@HOSTIP@/${HOSTIP}/g" \
|
||||||
-e "s#@NETWORK@#${NETWORK}#g" \
|
-e "s#@NETWORK@#${NETWORK}#g" \
|
||||||
|
-e "s/@API_PORT@/${API_PORT}/g" \
|
||||||
-e "s/@PORT@/${PORT}/g" \
|
-e "s/@PORT@/${PORT}/g" \
|
||||||
-e "s/@DCS_CONFIG@/${DCS_CONFIG}/g" \
|
-e "s/@DCS_CONFIG@/${DCS_CONFIG}/g" \
|
||||||
>> $CONFIG_FILE
|
>> $CONFIG_FILE
|
||||||
|
|
Loading…
Reference in a new issue