From 929e69dd0aeac357b812751fe3b8787fb773f1fb Mon Sep 17 00:00:00 2001 From: Michael Banck Date: Thu, 19 Mar 2020 19:15:11 +0100 Subject: [PATCH] * debian/pg_createcluster_patroni: remove vip-manager file before appending to it, patch by Tomas Pospisek (Closes: #953147). --- debian/changelog | 2 ++ debian/pg_createconfig_patroni | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/debian/changelog b/debian/changelog index 0a08df8..c2b94b7 100644 --- a/debian/changelog +++ b/debian/changelog @@ -3,6 +3,8 @@ patroni (1.6.4-2) UNRELEASED; urgency=medium [ Michael Banck ] * debian/pg_clonecluster_patroni: quote connstr in pg_createcluster invocation (Closes: #953623). + * debian/pg_createcluster_patroni: remove vip-manager file before appending + to it, patch by Tomas Pospisek (Closes: #953147). -- Debian PostgreSQL Maintainers Mon, 10 Feb 2020 10:03:07 +0100 diff --git a/debian/pg_createconfig_patroni b/debian/pg_createconfig_patroni index dff9b37..840e9ac 100755 --- a/debian/pg_createconfig_patroni +++ b/debian/pg_createconfig_patroni @@ -89,6 +89,13 @@ DCS_CONFIG="$(egrep -v '^[[:space:]]*$|^ *#' /etc/patroni/dcs.yml | sed -e ':a;N # check vip configuration if [ -n "$VIP_IP" ]; then VIP_FILE=/etc/patroni/${VERSION}-${CLUSTER}.vip + if [ -f $VIP_FILE -a -z "$FORCE" ]; then + echo "VIP configuration file already exists" + exit 1 + else + rm -f $VIP_FILE + touch $VIP_FILE + fi if [ ! -e /etc/patroni/vip.in ]; then echo "VIP template /etc/patroni/vip.in does not exist, cannot write VIP file" exit 1