Patroni PostgreSQL

Overview

This is a patroni postgresql jail that can be started with pot but it can also be deployed via nomad.

For more details about nomad images, see about potluck.

The jail exposes these parameters that can either be set via the environment or by setting the cookparameters (the latter either via nomad, see example below, or by editing the downloaded jails pot.conf file):

Installation

  • Create a ZFS dataset on the parent system beforehand:
    zfs create -o mountpoint=/mnt/postgresqldata zroot/postgresqldata
  • Create your local jail from the image or the flavour files.
  • Mount in the ZFS dataset you created:
    pot mount-in -p <jailname> -m /var/db/postgres -d /mnt/postgresqldata
  • Optionally export the ports after creating the jail:
    pot export-ports -p <jailname> -e 5432:5432
  • Adjust to your environment:
    sudo pot set-env -p <jailname> -E DATACENTER=<datacentername> -E NODENAME=<nodename> -E MYIP=<IP address of this node> -E SERVICETAG=<master/replica/standby-leader> -E CONSULSERVERS=<correctly-quoted-array-consul-IPs> [-E ADMPASS=<custom admin password> -E KEKPASS=<custom postgresql superuser password -E GOSSIPKEY=<32 byte Base64 key from consul keygen>]

The SERVICETAG parameter defines if this is a master, replica or standby-leader node in the cluster,

The CONSULSERVERS parameter defines the consul server instances, and must be set as CONSULSERVERS='"10.0.0.2"' or CONSULSERVERS='"10.0.0.2", "10.0.0.3", "10.0.0.4"' or CONSULSERVERS='"10.0.0.2", "10.0.0.3", "10.0.0.4", "10.0.0.5", "10.0.0.6"'

The GOSSIPKEY parameter is the gossip encryption key for consul agent. We’re using a default key if you do not set the parameter, do not use the default key for production encryption, instead provide your own.

Usage

You must su to the postgresql user and run psql to interact with Postgresql.

No default database exists. It will have to be setup or imported.

Getting Started

How To Use The Ready-Made Image

FreeBSD 13.0:
pot import -p postgresql-patroni-amd64-13_0 -t 2.0.5 -U https://potluck.honeyguide.net/postgresql-patroni

FreeBSD 12.2:
pot import -p postgresql-patroni-amd64-12_2 -t 2.0.5 -U https://potluck.honeyguide.net/postgresql-patroni

If you don’t want to use the default pot bridged network configuration but instead need an individual network setup (e.g. assign a host IP address), after importing it you can simply clone the jail like that (em0 is the host network adapter in this example):
pot clone -P postgresql-patroni-amd64-13_0 -p my-cloned-jail -N alias -i "em0|10.10.10.10"

Note: Some images might require specific network configuration, double check the Overview-chapter at the top.

Alternatively: Create a Jail With This Flavour Yourself

1. Create Flavour Files

Save all files and directories from https://github.com/hny-gd/potluck/tree/master/postgresql-patroni to /usr/local/etc/pot/flavours/

2. Create Jail From Flavour

Run
pot create -b <FreeBSD Version> -p <jailname> -t single -N public-bridge -f fbsd-update

with your FreeBSD version (e.g. 12.1) and the name your jail should get.

Note: Some images might require specific network configuration, double check the Overview-chapter at the top.

Version History

2.0.5

  • Updating for persistent postgresql storage

2.0.4

  • Adjusting parameters for node-exporter service

2.0.3

  • Added node_exporter and setup consul service “node-exporter”

2.0.2

  • Consul pre-generated gossip encryption key added

2.0.1

  • Fixing up minor type with trailing comma in consul agent.json setup

2.0

  • Several updates including new postgresql version, better parameter variables

1.0

  • Initial commit with PostgreSQL Patroni configuration that connects to Consul

These images were built on Sun May 30 14:33:47 UTC 2021

Manual Image Download Links

postgresql-patroni-amd64-13_0_2.0.5.xz ( 465.889 MB )
postgresql-patroni-amd64-13_0_2.0.5.xz.skein ( 0.250977 KB )

postgresql-patroni-amd64-12_2_2.0.5.xz ( 547.878 MB )
postgresql-patroni-amd64-12_2_2.0.5.xz.skein ( 0.250977 KB )

Jenkins Pot Creation Logs

postgresql-patroni-amd64-13_0_2.0.5:


postgresql-patroni/postgresql-patroni:
copy-in -s /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.rc -d /root/patroni.rc
copy-in -s /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.yml -d /root/patroni.yml
postgresql-patroni/postgresql-patroni.sh:
#!/bin/sh

# Based on POTLUCK TEMPLATE v3.0
# Altered by Michael Gmelin
#
# EDIT THE FOLLOWING FOR NEW FLAVOUR:
# 1. RUNS_IN_NOMAD - true or false
# 2. If RUNS_IN_NOMAD is false, can delete the <flavour>+4 file, else
#    make sure pot create command doesn't include it
# 3. Create a matching <flavour> file with this <flavour>.sh file that
#    contains the copy-in commands for the config files from <flavour>.d/
#    Remember that the package directories don't exist yet, so likely copy
#    to /root
# 4. Adjust package installation between BEGIN & END PACKAGE SETUP
# 5. Adjust jail configuration script generation between BEGIN & END COOK
#    Configure the config files that have been copied in where necessary

# Set this to true if this jail flavour is to be created as a nomad (i.e. blocking) jail.
# You can then query it in the cook script generation below and the script is installed
# appropriately at the end of this script
RUNS_IN_NOMAD=false

# set the cook log path/filename
COOKLOG=/var/log/cook.log

# check if cooklog exists, create it if not
if [ ! -e $COOKLOG ]
then
    echo "Creating $COOKLOG" | tee -a $COOKLOG
else
    echo "WARNING $COOKLOG already exists"  | tee -a $COOKLOG
fi
date >> $COOKLOG

# -------------------- COMMON ---------------

STEPCOUNT=0
step() {
  STEPCOUNT=$(expr "$STEPCOUNT" + 1)
  STEP="$@"
  echo "Step $STEPCOUNT: $STEP" | tee -a $COOKLOG
}

exit_ok() {
  trap - EXIT
  exit 0
}

FAILED=" failed"
exit_error() {
  STEP="$@"
  FAILED=""
  exit 1
}

set -e
trap 'echo ERROR: $STEP$FAILED | (>&2 tee -a $COOKLOG)' EXIT

# -------------- BEGIN PACKAGE SETUP -------------

step "Bootstrap package repo"
mkdir -p /usr/local/etc/pkg/repos
echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly" }' \
  >/usr/local/etc/pkg/repos/FreeBSD.conf
ASSUME_ALWAYS_YES=yes pkg bootstrap

step "Touch /etc/rc.conf"
touch /etc/rc.conf

# this is important, otherwise running /etc/rc from cook will
# overwrite the IP address set in tinirc
step "Remove ifconfig_epair0b from config"
sysrc -cq ifconfig_epair0b && sysrc -x ifconfig_epair0b || true

step "Disable sendmail"
service sendmail onedisable

step "Create /usr/local/etc/rc.d"
mkdir -p /usr/local/etc/rc.d

step "Update package repository"
pkg update -f

step "Install package sudo"
pkg install -y sudo

step "Install package openssl"
pkg install -y openssl

step "Install package vault"
pkg install -y vault

step "Install package consul"
pkg install -y consul

step "Install package node_exporter"
pkg install -y node_exporter

step "Install package postgresql-client"
pkg install -y postgresql13-client

step "Install package postgresql-server"
pkg install -y postgresql13-server

step "Install package python37"
pkg install -y python37

step "Install package python3-pip"
pkg install -y py37-pip

step "Install package python-consul2"
pkg install -y py37-python-consul2

step "Install package psycopg2"
pkg install -y py37-psycopg2
#
# pip MUST ONLY be used:
# * With the --user flag, OR
# * To install or manage Python packages in virtual environments
# using -prefix here to force install in /usr/local/bin

step "Install pip package patroni"
pip install patroni --prefix="/usr/local"
#
## WARNING: The scripts patroni, patroni_aws, patroni_raft_controller,
## patroni_wale_restore and patronictl are installed in
## '--prefix=/usr/local/bin' which is not on PATH.
## Consider adding this directory to PATH or, if you prefer to suppress
## this warning, use --no-warn-script-location.

step "Clean package installation"
pkg clean -y

# -------------- END PACKAGE SETUP -------------
#
# Create configurations
#

#
# Now generate the run command script "cook"
# It configures the system on the first run by creating the config file(s)
# On subsequent runs, it only starts sleeps (if nomad-jail) or simply exits
#

# clear any old cook runtime file
step "Remove pre-existing cook script (if any)"
rm -f /usr/local/bin/cook

# this runs when image boots
# ----------------- BEGIN COOK ------------------

step "Create cook script"
echo "#!/bin/sh
RUNS_IN_NOMAD=$RUNS_IN_NOMAD
# declare this again for the pot image, might work carrying variable through like
# with above
COOKLOG=/var/log/cook.log

# No need to change this, just ensures configuration is done only once
if [ -e /usr/local/etc/pot-is-seasoned ]
then
    # If this pot flavour is blocking (i.e. it should not return),
    # we block indefinitely
    if [ \"\$RUNS_IN_NOMAD\" = \"true\" ]
    then
        /bin/sh /etc/rc
        tail -f /dev/null
    fi
    exit 0
fi

# ADJUST THIS: STOP SERVICES AS NEEDED BEFORE CONFIGURATION
#

# stop consul agent
/usr/local/etc/rc.d/consul stop || true

# No need to adjust this:
# If this pot flavour is not blocking, we need to read the environment first from /tmp/environment.sh
# where pot is storing it in this case
if [ -e /tmp/environment.sh ]
then
    . /tmp/environment.sh
fi
#
# ADJUST THIS BY CHECKING FOR ALL VARIABLES YOUR FLAVOUR NEEDS:
# Check config variables are set
#
if [ -z \${DATACENTER+x} ];
then
    echo 'DATACENTER is unset - see documentation how to configure this flavour'
    exit 1
fi
if [ -z \${CONSULSERVERS+x} ];
then
    echo 'CONSULSERVERS is unset - see documentation how to configure this flavour'
    exit 1
fi
if [ -z \${NODENAME+x} ];
then
    echo 'The unique option NODENAME is unset - see documentation how to configure this flavour'
    exit 1
fi
if [ -z \${IP+x} ];
then
    echo 'IP is unset - see documentation how to configure this flavour'
    IP=\"127.0.0.1\"
fi
if [ -z \${SERVICETAG+x} ];
then
    echo 'SERVICETAG is unset - see documentation how to configure this flavour'
    SERVICETAG=master
fi
if [ -z \${ADMPASS+x} ];
then
    echo 'ADMPASS is unset - see documentation how to configure this flavour'
    ADMPASS=admin
fi
if [ -z \${KEKPASS+x} ];
then
    echo 'KEKPASS is unset - see documentation how to configure this flavour'
    KEKPASS=kekpass
fi
# GOSSIPKEY is a 32 byte, Base64 encoded key generated with consul keygen for the consul flavour.
# Re-used for nomad, which is usually 16 byte key but supports 32 byte, Base64 encoded keys
# We'll re-use the one from the consul flavour
if [ -z \${GOSSIPKEY+x} ];
then
    echo 'GOSSIPKEY is unset - see documentation how to configure this flavour, defaulting to preset encrypt key. Do not use this in production!'
    GOSSIPKEY='\"BY+vavBUSEmNzmxxS3k3bmVFn1giS4uEudc774nBhIw=\"'
fi

# make consul configuration directory and set permissions
mkdir -p /usr/local/etc/consul.d
chmod 750 /usr/local/etc/consul.d

# Create the consul agent config file with imported variables
echo \"{
 \\\"advertise_addr\\\": \\\"\$IP\\\",
 \\\"datacenter\\\": \\\"\$DATACENTER\\\",
 \\\"node_name\\\": \\\"\$NODENAME\\\",
 \\\"data_dir\\\":  \\\"/var/db/consul\\\",
 \\\"dns_config\\\": {
  \\\"a_record_limit\\\": 3,
  \\\"enable_truncate\\\": true
 },
 \\\"log_file\\\": \\\"/var/log/consul/\\\",
 \\\"log_level\\\": \\\"WARN\\\",
 \\\"encrypt\\\": \$GOSSIPKEY,
 \\\"start_join\\\": [ \$CONSULSERVERS ],
 \\\"service\\\": {
  \\\"address\\\": \\\"\$IP\\\",
  \\\"name\\\": \\\"node-exporter\\\",
  \\\"tags\\\": [\\\"_app=postgresql-patroni\\\", \\\"_service=node-exporter\\\", \\\"_hostname=\$NODENAME\\\", \\\"_datacenter=\$DATACENTER\\\"],
  \\\"port\\\": 9100
 }
}\" > /usr/local/etc/consul.d/agent.json

# set owner and perms on agent.json
chown consul:wheel /usr/local/etc/consul.d/agent.json
chmod 640 /usr/local/etc/consul.d/agent.json

# enable consul
sysrc consul_enable=\"YES\"

# set load parameter for consul config
sysrc consul_args=\"-config-file=/usr/local/etc/consul.d/agent.json\"
#sysrc consul_datadir=\"/var/db/consul\"

# Workaround for bug in rc.d/consul script:
sysrc consul_group=\"wheel\"

# setup consul logs, might be redundant if not specified in agent.json above
mkdir -p /var/log/consul
touch /var/log/consul/consul.log
chown -R consul:wheel /var/log/consul

# add the consul user to the wheel group, this seems to be required for
# consul to start on this instance. May need to figure out why.
# I'm not entirely sure this is the correct way to do it
/usr/sbin/pw usermod consul -G wheel

# enable node_exporter service
sysrc node_exporter_enable=\"YES\"

# set patroni variables in /root/patroni.yml before copy
if [ -f /root/patroni.yml ]; then
    # replace MYNAME with imported variable NODENAME which must be unique
    /usr/bin/sed -i .orig \"/MYNAME/s/MYNAME/\$NODENAME/g\" /root/patroni.yml

    # replace MYIP with imported variable IP
    /usr/bin/sed -i .orig \"/MYIP/s/MYIP/\$IP/g\" /root/patroni.yml

    # replace SERVICETAG with imported variable SERVICETAG
    /usr/bin/sed -i .orig \"/SERVICETAG/s/SERVICETAG/\$SERVICETAG/g\" /root/patroni.yml

    # replace CONSULIP with imported variable IP, as using local consul agent
    /usr/bin/sed -i .orig \"/CONSULIP/s/CONSULIP/\$IP/g\" /root/patroni.yml

    # replace ADMPASS with imported variable ADMPASS
    /usr/bin/sed -i .orig \"/ADMPASS/s/ADMPASS/\$ADMPASS/g\" /root/patroni.yml

    # replace KEKPASS with imported variable KEKPASS
    /usr/bin/sed -i .orig \"/KEKPASS/s/KEKPASS/\$KEKPASS/g\" /root/patroni.yml
fi

# create /usr/local/etc/patroni/
mkdir -p /usr/local/etc/patroni/

# copy the file to startup location
cp /root/patroni.yml /usr/local/etc/patroni/patroni.yml

# copy patroni startup script to /usr/local/etc/rc.d/
cp /root/patroni.rc /usr/local/etc/rc.d/patroni

# enable postgresql
sysrc postgresql_enable=\"YES\"

# enable patroni
sysrc patroni_enable=\"YES\"

# ensure permissions are good for /var/db/postgres mount-in
chown -R postgres:postgres /var/db/postgres

# end postgresql

# ADJUST THIS: START THE SERVICES AGAIN AFTER CONFIGURATION

# start consul agent
/usr/local/etc/rc.d/consul start

# start node_exporter
/usr/local/etc/rc.d/node_exporter start

# start patroni, which should start postgresql
/usr/local/etc/rc.d/patroni start

#
# Do not touch this:
touch /usr/local/etc/pot-is-seasoned

# If this pot flavour is blocking (i.e. it should not return), there is no /tmp/environment.sh
# created by pot and we now after configuration block indefinitely
if [ \"\$RUNS_IN_NOMAD\" = \"true\" ]
then
    /bin/sh /etc/rc
    tail -f /dev/null
fi
" > /usr/local/bin/cook

# ----------------- END COOK ------------------


# ---------- NO NEED TO EDIT BELOW ------------

step "Make cook script executable"
if [ -e /usr/local/bin/cook ]
then
    echo "setting executable bit on /usr/local/bin/cook" | tee -a $COOKLOG
    chmod u+x /usr/local/bin/cook
else
    exit_error "there is no /usr/local/bin/cook to make executable"
fi

#
# There are two ways of running a pot jail: "Normal", non-blocking mode and
# "Nomad", i.e. blocking mode (the pot start command does not return until
# the jail is stopped).
# For the normal mode, we create a /usr/local/etc/rc.d script that starts
# the "cook" script generated above each time, for the "Nomad" mode, the cook
# script is started by pot (configuration through flavour file), therefore
# we do not need to do anything here.
#

# Create rc.d script for "normal" mode:
step "Create rc.d script to start cook"
echo "creating rc.d script to start cook" | tee -a $COOKLOG

echo "#!/bin/sh
#
# PROVIDE: cook
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
. /etc/rc.subr
name=\"cook\"
rcvar=\"cook_enable\"
load_rc_config \$name
: \${cook_enable:=\"NO\"}
: \${cook_env:=\"\"}
command=\"/usr/local/bin/cook\"
command_args=\"\"
run_rc_command \"\$1\"
" > /usr/local/etc/rc.d/cook

step "Make rc.d script to start cook executable"
if [ -e /usr/local/etc/rc.d/cook ]
then
  echo "Setting executable bit on cook rc file" | tee -a $COOKLOG
  chmod u+x /usr/local/etc/rc.d/cook
else
  exit_error "/usr/local/etc/rc.d/cook does not exist"
fi

if [ "$RUNS_IN_NOMAD" != "true" ]
then
  step "Enable cook service"
  # This is a non-nomad (non-blocking) jail, so we need to make sure the script
  # gets started when the jail is started:
  # Otherwise, /usr/local/bin/cook will be set as start script by the pot flavour
  echo "enabling cook" | tee -a $COOKLOG
  service cook enable
fi

# -------------------- DONE ---------------
exit_ok

postgresql-patroni/postgresql-patroni+1:
postgresql-patroni/postgresql-patroni+1.sh:

postgresql-patroni/postgresql-patroni+2:
postgresql-patroni/postgresql-patroni+2.sh:

postgresql-patroni/postgresql-patroni+3:
postgresql-patroni/postgresql-patroni+3.sh:

postgresql-patroni/postgresql-patroni+4:
postgresql-patroni/postgresql-patroni+4.sh:
Password:===>  Creating a new pot
===>  pot name : postgresql-patroni-amd64-13_0
===>  type : single
===>  base : 13.0
===>  pot_base :
===>  level : 0
===>  network-type : public-bridge
===>  network-stack: ipv4
===>  ip : 10.192.0.3
===>  bridge :
===>  dns : inherit
===>  flavours : fbsd-update postgresql-patroni postgresql-patroni+1 postgresql-patroni+2 postgresql-patroni+3 postgresql-patroni+4
===>  Fetching FreeBSD 13.0
===>  Extract the tarball
=====>  Flavour: fbsd-update
=====>  Starting postgresql-patroni-amd64-13_0 pot for the initial bootstrap
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
defaultrouter: NO -> 10.192.0.1
===>  Starting the pot postgresql-patroni-amd64-13_0
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
	inet 127.0.0.1 netmask 0xff000000
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:df:71:93:ef:0b
	inet 10.192.0.3 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Updating /var/run/os-release done.
Creating and/or trimming log files.
Clearing /tmp (X related).
Updating motd:.
Starting syslogd.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.

Sun May 30 14:13:12 UTC 2021
/usr/local/etc/pot/flavours/fbsd-update.sh -> /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp/fbsd-update.sh
=====>  Executing fbsd-update script on postgresql-patroni-amd64-13_0
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching public key from update2.freebsd.org... done.
Fetching metadata signature for 13.0-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 5 patches... done.
Applying patches... done.
The following files will be updated as part of updating to
13.0-RELEASE-p1:
/bin/freebsd-version
/usr/bin/bc
/usr/bin/dc
/usr/lib/libradius.a
/usr/lib/libradius.so.4
/usr/lib/libradius_p.a
Installing updates...Scanning //usr/share/certs/blacklisted for certificates...
Scanning //usr/share/certs/trusted for certificates...
 done.
=====>  Stop the pot postgresql-patroni-amd64-13_0
=====>  Remove epair0[a|b] network interfaces
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/dev
=====>  Flavour: postgresql-patroni
=====>  Executing postgresql-patroni pot commands on postgresql-patroni-amd64-13_0
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
/usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.rc -> /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/root/patroni.rc
=====>  Source /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.rc copied in the pot postgresql-patroni-amd64-13_0
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
=====>  /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/dev is already unmounted
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
/usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.yml -> /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/root/patroni.yml
=====>  Source /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.yml copied in the pot postgresql-patroni-amd64-13_0
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
=====>  /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/dev is already unmounted
=====>  Starting postgresql-patroni-amd64-13_0 pot for the initial bootstrap
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
defaultrouter: 10.192.0.1 -> 10.192.0.1
===>  Starting the pot postgresql-patroni-amd64-13_0
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
	inet 127.0.0.1 netmask 0xff000000
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:e4:9e:5f:b0:0b
	inet 10.192.0.3 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Updating /var/run/os-release done.
Creating and/or trimming log files.
Clearing /tmp (X related).
Updating motd:.
Starting syslogd.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.

Sun May 30 14:13:28 UTC 2021
/usr/local/etc/pot/flavours/postgresql-patroni.sh -> /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp/postgresql-patroni.sh
=====>  Executing postgresql-patroni script on postgresql-patroni-amd64-13_0
Creating /var/log/cook.log
Step 1: Bootstrap package repo
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] Installing pkg-1.16.3...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] Extracting pkg-1.16.3: .......... done
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:13:amd64/quarterly, please wait...
Step 2: Touch /etc/rc.conf
Step 3: Remove ifconfig_epair0b from config
Step 4: Disable sendmail
sendmail disabled in /etc/rc.conf
sendmail_submit disabled in /etc/rc.conf
sendmail_msp_queue disabled in /etc/rc.conf
Step 5: Create /usr/local/etc/rc.d
Step 6: Update package repository
Updating FreeBSD repository catalogue...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] Fetching meta.conf: . done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] Fetching packagesite.txz: .......... done
Processing entries: .......... done
FreeBSD repository update completed. 30371 packages processed.
All repositories are up to date.
Step 7: Install package sudo
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: . done
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	gettext-runtime: 0.21
	indexinfo: 0.3.1
	sudo: 1.9.6p1

Number of packages to be installed: 3

The process will require 7 MiB more space.
1 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/3] Fetching sudo-1.9.6p1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/3] Fetching gettext-runtime-0.21.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/3] Fetching indexinfo-0.3.1.txz: . done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/3] Installing indexinfo-0.3.1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/3] Extracting indexinfo-0.3.1: .... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/3] Installing gettext-runtime-0.21...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/3] Extracting gettext-runtime-0.21: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/3] Installing sudo-1.9.6p1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/3] Extracting sudo-1.9.6p1: .......... done
Step 8: Install package openssl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	openssl: 1.1.1k_1,1

Number of packages to be installed: 1

The process will require 14 MiB more space.
4 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching openssl-1.1.1k_1,1.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing openssl-1.1.1k_1,1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting openssl-1.1.1k_1,1: .......... done
Step 9: Install package vault
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	vault: 1.6.3

Number of packages to be installed: 1

The process will require 138 MiB more space.
45 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching vault-1.6.3.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing vault-1.6.3...
===> Creating groups.
Creating group 'vault' with gid '471'.
===> Creating users
Creating user 'vault' with uid '471'.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting vault-1.6.3: ..... done
=====
Message from vault-1.6.3:

--
The vault user created by the vault package is now a member of the daemon
class, which will allow it to use mlock() when started by the rc script. This
will not be reflected in systems where the user already exists. Please add the
vault user to the daemon class manually by running:

pw usermod -L daemon -n vault

or delete the user and reinstall the package.

You may also need to increase memorylocked for the daemon class in
/etc/login.conf to 1024M or more and run:

cap_mkdb /etc/login.conf

Or to disable mlock, add:

disable_mlock = 1

to /usr/local/etc/vault.hcl
Step 10: Install package consul
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	consul: 1.9.4

Number of packages to be installed: 1

The process will require 78 MiB more space.
27 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching consul-1.9.4.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing consul-1.9.4...
===> Creating groups.
Creating group 'consul' with gid '469'.
===> Creating users
Creating user 'consul' with uid '469'.
===> Creating homedir(s)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting consul-1.9.4: ..... done
Step 11: Install package node_exporter
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	node_exporter: 1.1.2

Number of packages to be installed: 1

The process will require 11 MiB more space.
3 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching node_exporter-1.1.2.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Installing node_exporter-1.1.2...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting node_exporter-1.1.2: .......... done
=====
Message from node_exporter-1.1.2:

--
If upgrading from a version of node_exporter <0.15.0 you'll need to update any
custom command line flags that you may have set as it now requires a
double-dash (--flag) instead of a single dash (-flag).
The collector flags in 0.15.0 have now been replaced with individual boolean
flags and the -collector.procfs` and -collector.sysfs` flags have been renamed
to --path.procfs and --path.sysfs respectively.
Step 12: Install package postgresql-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	postgresql13-client: 13.3
	readline: 8.1.0

Number of packages to be installed: 2

The process will require 14 MiB more space.
3 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching postgresql13-client-13.3.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching readline-8.1.0.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/2] Installing readline-8.1.0...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting readline-8.1.0: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/2] Installing postgresql13-client-13.3...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting postgresql13-client-13.3: .......... done
=====
Message from postgresql13-client-13.3:

--
The PostgreSQL port has a collection of "side orders":

postgresql-docs
  For all of the html documentation

p5-Pg
  A perl5 API for client access to PostgreSQL databases.

postgresql-tcltk 
  If you want tcl/tk client support.

postgresql-jdbc
  For Java JDBC support.

postgresql-odbc
  For client access from unix applications using ODBC as access
  method. Not needed to access unix PostgreSQL servers from Win32
  using ODBC. See below.

ruby-postgres, py-psycopg2
  For client access to PostgreSQL databases using the ruby & python
  languages.

postgresql-plperl, postgresql-pltcl & postgresql-plruby
  For using perl5, tcl & ruby as procedural languages.

postgresql-contrib
  Lots of contributed utilities, postgresql functions and
  datatypes. There you find pg_standby, pgcrypto and many other cool
  things.

etc...
Step 13: Install package postgresql-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 9 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	icu: 68.2,1
	libedit: 3.1.20210216,1
	libffi: 3.3_1
	libxml2: 2.9.10_4
	llvm11: 11.0.1
	lua52: 5.2.4
	perl5: 5.32.1_1
	postgresql13-server: 13.3
	python37: 3.7.10

Number of packages to be installed: 9

The process will require 975 MiB more space.
161 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/9] Fetching postgresql13-server-13.3.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/9] Fetching llvm11-11.0.1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/9] Fetching libxml2-2.9.10_4.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/9] Fetching python37-3.7.10.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [5/9] Fetching libffi-3.3_1.txz: ..... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [6/9] Fetching perl5-5.32.1_1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [7/9] Fetching lua52-5.2.4.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [8/9] Fetching libedit-3.1.20210216,1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [9/9] Fetching icu-68.2,1.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/9] Installing libffi-3.3_1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/9] Extracting libffi-3.3_1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/9] Installing libedit-3.1.20210216,1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/9] Extracting libedit-3.1.20210216,1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/9] Installing libxml2-2.9.10_4...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/9] Extracting libxml2-2.9.10_4: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/9] Installing python37-3.7.10...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/9] Extracting python37-3.7.10: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [5/9] Installing perl5-5.32.1_1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [5/9] Extracting perl5-5.32.1_1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [6/9] Installing lua52-5.2.4...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [6/9] Extracting lua52-5.2.4: ......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [7/9] Installing llvm11-11.0.1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [7/9] Extracting llvm11-11.0.1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [8/9] Installing icu-68.2,1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [8/9] Extracting icu-68.2,1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [9/9] Installing postgresql13-server-13.3...
===> Creating groups.
Creating group 'postgres' with gid '770'.
===> Creating users
Creating user 'postgres' with uid '770'.
===> Creating homedir(s)

  =========== BACKUP YOUR DATA! =============
  As always, backup your data before
  upgrading. If the upgrade leads to a higher
  major revision (e.g. 9.6 -> 10), a dump
  and restore of all databases is
  required. This is *NOT* done by the port!
  See https://www.postgresql.org/docs/current/upgrading.html
  ===========================================
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [9/9] Extracting postgresql13-server-13.3: .......... done
=====
Message from python37-3.7.10:

--
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:

py37-gdbm       databases/py-gdbm@py37
py37-sqlite3    databases/py-sqlite3@py37
py37-tkinter    x11-toolkits/py-tkinter@py37
=====
Message from postgresql13-server-13.3:

--
For procedural languages and postgresql functions, please note that
you might have to update them when updating the server.

If you have many tables and many clients running, consider raising
kern.maxfiles using sysctl(8), or reconfigure your kernel
appropriately.

The port is set up to use autovacuum for new databases, but you might
also want to vacuum and perhaps backup your database regularly. There
is a periodic script, /usr/local/etc/periodic/daily/502.pgsql, that
you may find useful. You can use it to backup and perform vacuum on all
databases nightly. Per default, it performs `vacuum analyze'. See the
script for instructions. For autovacuum settings, please review
~postgres/data/postgresql.conf.

If you plan to access your PostgreSQL server using ODBC, please
consider running the SQL script /usr/local/share/postgresql/odbc.sql
to get the functions required for ODBC compliance.

Please note that if you use the rc script,
/usr/local/etc/rc.d/postgresql, to initialize the database, unicode
(UTF-8) will be used to store character data by default.  Set
postgresql_initdb_flags or use login.conf settings described below to
alter this behaviour. See the start rc script for more info.

To set limits, environment stuff like locale and collation and other
things, you can set up a class in /etc/login.conf before initializing
the database. Add something similar to this to /etc/login.conf:
---
postgres:\
	:lang=en_US.UTF-8:\
	:setenv=LC_COLLATE=C:\
	:tc=default:
---
and run `cap_mkdb /etc/login.conf'.
Then add 'postgresql_class="postgres"' to /etc/rc.conf.

======================================================================

To initialize the database, run

  /usr/local/etc/rc.d/postgresql initdb

You can then start PostgreSQL by running:

  /usr/local/etc/rc.d/postgresql start

For postmaster settings, see ~postgres/data/postgresql.conf

NB. FreeBSD's PostgreSQL port logs to syslog by default
    See ~postgres/data/postgresql.conf for more info

NB. If you're not using a checksumming filesystem like ZFS, you might
    wish to enable data checksumming. It can be enabled during
    the initdb phase, by adding the "--data-checksums" flag to
    the postgresql_initdb_flags rcvar. Otherwise you can enable it later by
    pg_checksums.  Check the initdb(1) manpage for more info
    and make sure you understand the performance implications.

======================================================================

To run PostgreSQL at startup, add
'postgresql_enable="YES"' to /etc/rc.conf
Step 14: Install package python37
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 15: Install package python3-pip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py37-pip: 20.2.3
	py37-setuptools: 44.0.0

Number of packages to be installed: 2

The process will require 16 MiB more space.
2 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching py37-pip-20.2.3.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching py37-setuptools-44.0.0.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/2] Installing py37-setuptools-44.0.0...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting py37-setuptools-44.0.0: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/2] Installing py37-pip-20.2.3...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting py37-pip-20.2.3: .......... done
=====
Message from py37-pip-20.2.3:

--
pip MUST ONLY be used:

 * With the --user flag, OR
 * To install or manage Python packages in virtual environments

Failure to follow this warning can and will result in an inconsistent
system-wide Python environment (LOCALBASE/lib/pythonX.Y/site-packages) and
cause errors.

Avoid using pip as root unless you know what you're doing.
Step 16: Install package python-consul2
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 12 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py37-certifi: 2020.12.5
	py37-cffi: 1.14.5
	py37-chardet: 3.0.4_3,1
	py37-cryptography: 3.3.2
	py37-idna: 2.10
	py37-openssl: 20.0.1
	py37-pycparser: 2.20
	py37-pysocks: 1.7.1
	py37-python-consul2: 0.1.5
	py37-requests: 2.25.1
	py37-six: 1.15.0
	py37-urllib3: 1.25.11,1

Number of packages to be installed: 12

The process will require 9 MiB more space.
1 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/12] Fetching py37-python-consul2-0.1.5.txz: ...... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/12] Fetching py37-requests-2.25.1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/12] Fetching py37-chardet-3.0.4_3,1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/12] Fetching py37-certifi-2020.12.5.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [5/12] Fetching py37-urllib3-1.25.11,1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [6/12] Fetching py37-openssl-20.0.1.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [7/12] Fetching py37-cryptography-3.3.2.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [8/12] Fetching py37-six-1.15.0.txz: ... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [9/12] Fetching py37-cffi-1.14.5.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [10/12] Fetching py37-pycparser-2.20.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [11/12] Fetching py37-pysocks-1.7.1.txz: ... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [12/12] Fetching py37-idna-2.10.txz: ........ done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/12] Installing py37-pycparser-2.20...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/12] Extracting py37-pycparser-2.20: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/12] Installing py37-six-1.15.0...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/12] Extracting py37-six-1.15.0: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/12] Installing py37-cffi-1.14.5...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/12] Extracting py37-cffi-1.14.5: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/12] Installing py37-cryptography-3.3.2...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/12] Extracting py37-cryptography-3.3.2: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [5/12] Installing py37-certifi-2020.12.5...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [5/12] Extracting py37-certifi-2020.12.5: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [6/12] Installing py37-openssl-20.0.1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [6/12] Extracting py37-openssl-20.0.1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [7/12] Installing py37-pysocks-1.7.1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [7/12] Extracting py37-pysocks-1.7.1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [8/12] Installing py37-idna-2.10...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [8/12] Extracting py37-idna-2.10: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [9/12] Installing py37-chardet-3.0.4_3,1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [9/12] Extracting py37-chardet-3.0.4_3,1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [10/12] Installing py37-urllib3-1.25.11,1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [10/12] Extracting py37-urllib3-1.25.11,1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [11/12] Installing py37-requests-2.25.1...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [11/12] Extracting py37-requests-2.25.1: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [12/12] Installing py37-python-consul2-0.1.5...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [12/12] Extracting py37-python-consul2-0.1.5: .......... done
=====
Message from py37-urllib3-1.25.11,1:

--
Since version 1.25 HTTPS connections are now verified by default which is done
via "cert_reqs = 'CERT_REQUIRED'".  While certificate verification can be
disabled via "cert_reqs = 'CERT_NONE'", it's highly recommended to leave it on.

Various consumers of net/py-urllib3 already have implemented routines that
either explicitly enable or disable HTTPS certificate verification (e.g. via
configuration settings, CLI arguments, etc.).

Yet it may happen that there are still some consumers which don't explicitly
enable/disable certificate verification for HTTPS connections which could then
lead to errors (as is often the case with self-signed certificates).

In case of an error one should try first to temporarily disable certificate
verification of the problematic urllib3 consumer to see if that approach will
remedy the issue.
Step 17: Install package psycopg2
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	postgresql12-client: 12.7
	py37-psycopg2: 2.8.6

Number of packages to be installed: 2

The process will require 13 MiB more space.
3 MiB to be downloaded.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching py37-psycopg2-2.8.6.txz: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching postgresql12-client-12.7.txz: .......... done
Checking integrity... done (2 conflicting)
  - postgresql12-client-12.7 conflicts with postgresql13-client-13.3 on /usr/local/bin/clusterdb
  - postgresql12-client-12.7 conflicts with postgresql13-client-13.3 on /usr/local/bin/clusterdb
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 4 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
	postgresql13-client: 13.3
	postgresql13-server: 13.3

New packages to be INSTALLED:
	postgresql12-client: 12.7
	py37-psycopg2: 2.8.6

Number of packages to be removed: 2
Number of packages to be installed: 2

The operation will free 41 MiB.
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/4] Deinstalling postgresql13-server-13.3...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [1/4] Deleting files for postgresql13-server-13.3: .......... done
==> You should manually remove the "postgres" user. 
==> You should manually remove the "postgres" group 
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/4] Deinstalling postgresql13-client-13.3...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [2/4] Deleting files for postgresql13-client-13.3: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/4] Installing postgresql12-client-12.7...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [3/4] Extracting postgresql12-client-12.7: .......... done
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/4] Installing py37-psycopg2-2.8.6...
[postgresql-patroni-amd64-13_0.vsf00001.cpt.za.honeyguide.net] [4/4] Extracting py37-psycopg2-2.8.6: .......... done
=====
Message from postgresql12-client-12.7:

--
The PostgreSQL port has a collection of "side orders":

postgresql-docs
  For all of the html documentation

p5-Pg
  A perl5 API for client access to PostgreSQL databases.

postgresql-tcltk 
  If you want tcl/tk client support.

postgresql-jdbc
  For Java JDBC support.

postgresql-odbc
  For client access from unix applications using ODBC as access
  method. Not needed to access unix PostgreSQL servers from Win32
  using ODBC. See below.

ruby-postgres, py-psycopg2
  For client access to PostgreSQL databases using the ruby & python
  languages.

postgresql-plperl, postgresql-pltcl & postgresql-plruby
  For using perl5, tcl & ruby as procedural languages.

postgresql-contrib
  Lots of contributed utilities, postgresql functions and
  datatypes. There you find pg_standby, pgcrypto and many other cool
  things.

etc...
Step 18: Install pip package patroni
Collecting patroni
  Downloading patroni-2.0.2-py3-none-any.whl (211 kB)
Collecting click>=4.1
  Downloading click-8.0.1-py3-none-any.whl (97 kB)
Collecting PyYAML
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting prettytable>=0.7
  Downloading prettytable-2.1.0-py3-none-any.whl (22 kB)
Collecting python-dateutil
  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting ydiff>=1.2.0
  Downloading ydiff-1.2.tar.gz (42 kB)
Collecting psutil>=2.0.0
  Downloading psutil-5.8.0.tar.gz (470 kB)
Requirement already satisfied: urllib3!=1.21,>=1.19.1 in /usr/local/lib/python3.7/site-packages (from patroni) (1.25.11)
Requirement already satisfied: six>=1.7 in /usr/local/lib/python3.7/site-packages (from patroni) (1.15.0)
Collecting importlib-metadata; python_version < "3.8"
  Downloading importlib_metadata-4.3.1-py3-none-any.whl (16 kB)
Collecting wcwidth
  Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting typing-extensions>=3.6.4; python_version < "3.8"
  Downloading typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)
Collecting zipp>=0.5
  Downloading zipp-3.4.1-py3-none-any.whl (5.2 kB)
Using legacy 'setup.py install' for ydiff, since package 'wheel' is not installed.
Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Building wheels for collected packages: PyYAML
  Building wheel for PyYAML (PEP 517): started
  Building wheel for PyYAML (PEP 517): finished with status 'done'
  Created wheel for PyYAML: filename=PyYAML-5.4.1-cp37-cp37m-freebsd_13_0_release_p1_amd64.whl size=45670 sha256=8b9486bc1e18539c6ff5f7d95e780fbe8fbf186e49ba749ab2464a9836d1ac87
  Stored in directory: /root/.cache/pip/wheels/f4/51/cc/858604f7bb9cab887106ff266a541546ad783b4fa20875051d
Successfully built PyYAML
Installing collected packages: typing-extensions, zipp, importlib-metadata, click, PyYAML, wcwidth, prettytable, python-dateutil, ydiff, psutil, patroni
    Running setup.py install for ydiff: started
    Running setup.py install for ydiff: finished with status 'done'
    Running setup.py install for psutil: started
    Running setup.py install for psutil: finished with status 'done'
Successfully installed PyYAML-5.4.1 click-8.0.1 importlib-metadata-4.3.1 patroni-2.0.2 prettytable-2.1.0 psutil-5.8.0 python-dateutil-2.8.1 typing-extensions-3.10.0.0 wcwidth-0.2.5 ydiff-1.2 zipp-3.4.1
Step 19: Clean package installation
The following package files will be deleted:
	/var/cache/pkg/sudo-1.9.6p1.txz
	/var/cache/pkg/llvm11-11.0.1.txz
	/var/cache/pkg/py37-idna-2.10.txz
	/var/cache/pkg/py37-pysocks-1.7.1~25f0498fbb.txz
	/var/cache/pkg/node_exporter-1.1.2~f0726150af.txz
	/var/cache/pkg/libxml2-2.9.10_4.txz
	/var/cache/pkg/vault-1.6.3.txz
	/var/cache/pkg/perl5-5.32.1_1~4d2fd68a5e.txz
	/var/cache/pkg/py37-openssl-20.0.1.txz
	/var/cache/pkg/gettext-runtime-0.21.txz
	/var/cache/pkg/py37-six-1.15.0~6f1a2a44f7.txz
	/var/cache/pkg/py37-chardet-3.0.4_3,1.txz
	/var/cache/pkg/postgresql13-client-13.3~101f30e8cd.txz
	/var/cache/pkg/python37-3.7.10.txz
	/var/cache/pkg/py37-pycparser-2.20~89ed55dea9.txz
	/var/cache/pkg/libedit-3.1.20210216,1.txz
	/var/cache/pkg/perl5-5.32.1_1.txz
	/var/cache/pkg/readline-8.1.0.txz
	/var/cache/pkg/postgresql13-server-13.3.txz
	/var/cache/pkg/postgresql12-client-12.7~103b4aa4dc.txz
	/var/cache/pkg/py37-pip-20.2.3.txz
	/var/cache/pkg/consul-1.9.4.txz
	/var/cache/pkg/gettext-runtime-0.21~4f88146680.txz
	/var/cache/pkg/sudo-1.9.6p1~eb37b91581.txz
	/var/cache/pkg/indexinfo-0.3.1~75a19b3acb.txz
	/var/cache/pkg/icu-68.2,1~641ceaeaaf.txz
	/var/cache/pkg/py37-six-1.15.0.txz
	/var/cache/pkg/postgresql13-client-13.3.txz
	/var/cache/pkg/py37-urllib3-1.25.11,1.txz
	/var/cache/pkg/postgresql13-server-13.3~87245a5791.txz
	/var/cache/pkg/py37-requests-2.25.1.txz
	/var/cache/pkg/py37-chardet-3.0.4_3,1~1988680796.txz
	/var/cache/pkg/py37-requests-2.25.1~f0ac6a0d5a.txz
	/var/cache/pkg/postgresql12-client-12.7.txz
	/var/cache/pkg/lua52-5.2.4.txz
	/var/cache/pkg/libffi-3.3_1~7045e0d9d8.txz
	/var/cache/pkg/py37-pip-20.2.3~6582c1a98c.txz
	/var/cache/pkg/icu-68.2,1.txz
	/var/cache/pkg/py37-urllib3-1.25.11,1~789f357471.txz
	/var/cache/pkg/vault-1.6.3~424dc5f89a.txz
	/var/cache/pkg/llvm11-11.0.1~f7ff7d686a.txz
	/var/cache/pkg/libffi-3.3_1.txz
	/var/cache/pkg/libxml2-2.9.10_4~2804980ce6.txz
	/var/cache/pkg/py37-cffi-1.14.5~446dcb25ec.txz
	/var/cache/pkg/openssl-1.1.1k_1,1~f27ed18db7.txz
	/var/cache/pkg/py37-cffi-1.14.5.txz
	/var/cache/pkg/lua52-5.2.4~16cd1affb1.txz
	/var/cache/pkg/py37-pycparser-2.20.txz
	/var/cache/pkg/py37-openssl-20.0.1~97e7ea493d.txz
	/var/cache/pkg/py37-psycopg2-2.8.6~143ca658d0.txz
	/var/cache/pkg/python37-3.7.10~e4b2f3b0fa.txz
	/var/cache/pkg/py37-python-consul2-0.1.5~8f680b6cf7.txz
	/var/cache/pkg/py37-setuptools-44.0.0~4ff100bdec.txz
	/var/cache/pkg/py37-certifi-2020.12.5.txz
	/var/cache/pkg/py37-psycopg2-2.8.6.txz
	/var/cache/pkg/py37-python-consul2-0.1.5.txz
	/var/cache/pkg/py37-idna-2.10~b81706ee9f.txz
	/var/cache/pkg/py37-pysocks-1.7.1.txz
	/var/cache/pkg/py37-setuptools-44.0.0.txz
	/var/cache/pkg/indexinfo-0.3.1.txz
	/var/cache/pkg/py37-certifi-2020.12.5~e528572fb6.txz
	/var/cache/pkg/node_exporter-1.1.2.txz
	/var/cache/pkg/py37-cryptography-3.3.2~32337391ae.txz
	/var/cache/pkg/openssl-1.1.1k_1,1.txz
	/var/cache/pkg/readline-8.1.0~43a7074e03.txz
	/var/cache/pkg/py37-cryptography-3.3.2.txz
	/var/cache/pkg/libedit-3.1.20210216,1~045d9e4631.txz
	/var/cache/pkg/consul-1.9.4~95d640becc.txz
The cleanup will free 252 MiB
Deleting files: .......... done
All done
Step 20: Remove pre-existing cook script (if any)
Step 21: Create cook script
Step 22: Make cook script executable
setting executable bit on /usr/local/bin/cook
Step 23: Create rc.d script to start cook
creating rc.d script to start cook
Step 24: Make rc.d script to start cook executable
Setting executable bit on cook rc file
Step 25: Enable cook service
enabling cook
cook enabled in /etc/rc.conf
=====>  Stop the pot postgresql-patroni-amd64-13_0
=====>  Remove epair0[a|b] network interfaces
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/tmp
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-13_0/m/dev
=====>  Flavour: postgresql-patroni+1
=====>  Executing postgresql-patroni+1 pot commands on postgresql-patroni-amd64-13_0
=====>  No shell script available for the flavour postgresql-patroni+1
=====>  Flavour: postgresql-patroni+2
=====>  Executing postgresql-patroni+2 pot commands on postgresql-patroni-amd64-13_0
=====>  No shell script available for the flavour postgresql-patroni+2
=====>  Flavour: postgresql-patroni+3
=====>  Executing postgresql-patroni+3 pot commands on postgresql-patroni-amd64-13_0
=====>  No shell script available for the flavour postgresql-patroni+3
=====>  Flavour: postgresql-patroni+4
=====>  Executing postgresql-patroni+4 pot commands on postgresql-patroni-amd64-13_0
=====>  No shell script available for the flavour postgresql-patroni+4

postgresql-patroni-amd64-12_2_2.0.5:


postgresql-patroni/postgresql-patroni:
copy-in -s /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.rc -d /root/patroni.rc
copy-in -s /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.yml -d /root/patroni.yml
postgresql-patroni/postgresql-patroni.sh:
#!/bin/sh

# Based on POTLUCK TEMPLATE v3.0
# Altered by Michael Gmelin
#
# EDIT THE FOLLOWING FOR NEW FLAVOUR:
# 1. RUNS_IN_NOMAD - true or false
# 2. If RUNS_IN_NOMAD is false, can delete the <flavour>+4 file, else
#    make sure pot create command doesn't include it
# 3. Create a matching <flavour> file with this <flavour>.sh file that
#    contains the copy-in commands for the config files from <flavour>.d/
#    Remember that the package directories don't exist yet, so likely copy
#    to /root
# 4. Adjust package installation between BEGIN & END PACKAGE SETUP
# 5. Adjust jail configuration script generation between BEGIN & END COOK
#    Configure the config files that have been copied in where necessary

# Set this to true if this jail flavour is to be created as a nomad (i.e. blocking) jail.
# You can then query it in the cook script generation below and the script is installed
# appropriately at the end of this script
RUNS_IN_NOMAD=false

# set the cook log path/filename
COOKLOG=/var/log/cook.log

# check if cooklog exists, create it if not
if [ ! -e $COOKLOG ]
then
    echo "Creating $COOKLOG" | tee -a $COOKLOG
else
    echo "WARNING $COOKLOG already exists"  | tee -a $COOKLOG
fi
date >> $COOKLOG

# -------------------- COMMON ---------------

STEPCOUNT=0
step() {
  STEPCOUNT=$(expr "$STEPCOUNT" + 1)
  STEP="$@"
  echo "Step $STEPCOUNT: $STEP" | tee -a $COOKLOG
}

exit_ok() {
  trap - EXIT
  exit 0
}

FAILED=" failed"
exit_error() {
  STEP="$@"
  FAILED=""
  exit 1
}

set -e
trap 'echo ERROR: $STEP$FAILED | (>&2 tee -a $COOKLOG)' EXIT

# -------------- BEGIN PACKAGE SETUP -------------

step "Bootstrap package repo"
mkdir -p /usr/local/etc/pkg/repos
echo 'FreeBSD: { url: "pkg+http://pkg.FreeBSD.org/${ABI}/quarterly" }' \
  >/usr/local/etc/pkg/repos/FreeBSD.conf
ASSUME_ALWAYS_YES=yes pkg bootstrap

step "Touch /etc/rc.conf"
touch /etc/rc.conf

# this is important, otherwise running /etc/rc from cook will
# overwrite the IP address set in tinirc
step "Remove ifconfig_epair0b from config"
sysrc -cq ifconfig_epair0b && sysrc -x ifconfig_epair0b || true

step "Disable sendmail"
service sendmail onedisable

step "Create /usr/local/etc/rc.d"
mkdir -p /usr/local/etc/rc.d

step "Update package repository"
pkg update -f

step "Install package sudo"
pkg install -y sudo

step "Install package openssl"
pkg install -y openssl

step "Install package vault"
pkg install -y vault

step "Install package consul"
pkg install -y consul

step "Install package node_exporter"
pkg install -y node_exporter

step "Install package postgresql-client"
pkg install -y postgresql13-client

step "Install package postgresql-server"
pkg install -y postgresql13-server

step "Install package python37"
pkg install -y python37

step "Install package python3-pip"
pkg install -y py37-pip

step "Install package python-consul2"
pkg install -y py37-python-consul2

step "Install package psycopg2"
pkg install -y py37-psycopg2
#
# pip MUST ONLY be used:
# * With the --user flag, OR
# * To install or manage Python packages in virtual environments
# using -prefix here to force install in /usr/local/bin

step "Install pip package patroni"
pip install patroni --prefix="/usr/local"
#
## WARNING: The scripts patroni, patroni_aws, patroni_raft_controller,
## patroni_wale_restore and patronictl are installed in
## '--prefix=/usr/local/bin' which is not on PATH.
## Consider adding this directory to PATH or, if you prefer to suppress
## this warning, use --no-warn-script-location.

step "Clean package installation"
pkg clean -y

# -------------- END PACKAGE SETUP -------------
#
# Create configurations
#

#
# Now generate the run command script "cook"
# It configures the system on the first run by creating the config file(s)
# On subsequent runs, it only starts sleeps (if nomad-jail) or simply exits
#

# clear any old cook runtime file
step "Remove pre-existing cook script (if any)"
rm -f /usr/local/bin/cook

# this runs when image boots
# ----------------- BEGIN COOK ------------------

step "Create cook script"
echo "#!/bin/sh
RUNS_IN_NOMAD=$RUNS_IN_NOMAD
# declare this again for the pot image, might work carrying variable through like
# with above
COOKLOG=/var/log/cook.log

# No need to change this, just ensures configuration is done only once
if [ -e /usr/local/etc/pot-is-seasoned ]
then
    # If this pot flavour is blocking (i.e. it should not return),
    # we block indefinitely
    if [ \"\$RUNS_IN_NOMAD\" = \"true\" ]
    then
        /bin/sh /etc/rc
        tail -f /dev/null
    fi
    exit 0
fi

# ADJUST THIS: STOP SERVICES AS NEEDED BEFORE CONFIGURATION
#

# stop consul agent
/usr/local/etc/rc.d/consul stop || true

# No need to adjust this:
# If this pot flavour is not blocking, we need to read the environment first from /tmp/environment.sh
# where pot is storing it in this case
if [ -e /tmp/environment.sh ]
then
    . /tmp/environment.sh
fi
#
# ADJUST THIS BY CHECKING FOR ALL VARIABLES YOUR FLAVOUR NEEDS:
# Check config variables are set
#
if [ -z \${DATACENTER+x} ];
then
    echo 'DATACENTER is unset - see documentation how to configure this flavour'
    exit 1
fi
if [ -z \${CONSULSERVERS+x} ];
then
    echo 'CONSULSERVERS is unset - see documentation how to configure this flavour'
    exit 1
fi
if [ -z \${NODENAME+x} ];
then
    echo 'The unique option NODENAME is unset - see documentation how to configure this flavour'
    exit 1
fi
if [ -z \${IP+x} ];
then
    echo 'IP is unset - see documentation how to configure this flavour'
    IP=\"127.0.0.1\"
fi
if [ -z \${SERVICETAG+x} ];
then
    echo 'SERVICETAG is unset - see documentation how to configure this flavour'
    SERVICETAG=master
fi
if [ -z \${ADMPASS+x} ];
then
    echo 'ADMPASS is unset - see documentation how to configure this flavour'
    ADMPASS=admin
fi
if [ -z \${KEKPASS+x} ];
then
    echo 'KEKPASS is unset - see documentation how to configure this flavour'
    KEKPASS=kekpass
fi
# GOSSIPKEY is a 32 byte, Base64 encoded key generated with consul keygen for the consul flavour.
# Re-used for nomad, which is usually 16 byte key but supports 32 byte, Base64 encoded keys
# We'll re-use the one from the consul flavour
if [ -z \${GOSSIPKEY+x} ];
then
    echo 'GOSSIPKEY is unset - see documentation how to configure this flavour, defaulting to preset encrypt key. Do not use this in production!'
    GOSSIPKEY='\"BY+vavBUSEmNzmxxS3k3bmVFn1giS4uEudc774nBhIw=\"'
fi

# make consul configuration directory and set permissions
mkdir -p /usr/local/etc/consul.d
chmod 750 /usr/local/etc/consul.d

# Create the consul agent config file with imported variables
echo \"{
 \\\"advertise_addr\\\": \\\"\$IP\\\",
 \\\"datacenter\\\": \\\"\$DATACENTER\\\",
 \\\"node_name\\\": \\\"\$NODENAME\\\",
 \\\"data_dir\\\":  \\\"/var/db/consul\\\",
 \\\"dns_config\\\": {
  \\\"a_record_limit\\\": 3,
  \\\"enable_truncate\\\": true
 },
 \\\"log_file\\\": \\\"/var/log/consul/\\\",
 \\\"log_level\\\": \\\"WARN\\\",
 \\\"encrypt\\\": \$GOSSIPKEY,
 \\\"start_join\\\": [ \$CONSULSERVERS ],
 \\\"service\\\": {
  \\\"address\\\": \\\"\$IP\\\",
  \\\"name\\\": \\\"node-exporter\\\",
  \\\"tags\\\": [\\\"_app=postgresql-patroni\\\", \\\"_service=node-exporter\\\", \\\"_hostname=\$NODENAME\\\", \\\"_datacenter=\$DATACENTER\\\"],
  \\\"port\\\": 9100
 }
}\" > /usr/local/etc/consul.d/agent.json

# set owner and perms on agent.json
chown consul:wheel /usr/local/etc/consul.d/agent.json
chmod 640 /usr/local/etc/consul.d/agent.json

# enable consul
sysrc consul_enable=\"YES\"

# set load parameter for consul config
sysrc consul_args=\"-config-file=/usr/local/etc/consul.d/agent.json\"
#sysrc consul_datadir=\"/var/db/consul\"

# Workaround for bug in rc.d/consul script:
sysrc consul_group=\"wheel\"

# setup consul logs, might be redundant if not specified in agent.json above
mkdir -p /var/log/consul
touch /var/log/consul/consul.log
chown -R consul:wheel /var/log/consul

# add the consul user to the wheel group, this seems to be required for
# consul to start on this instance. May need to figure out why.
# I'm not entirely sure this is the correct way to do it
/usr/sbin/pw usermod consul -G wheel

# enable node_exporter service
sysrc node_exporter_enable=\"YES\"

# set patroni variables in /root/patroni.yml before copy
if [ -f /root/patroni.yml ]; then
    # replace MYNAME with imported variable NODENAME which must be unique
    /usr/bin/sed -i .orig \"/MYNAME/s/MYNAME/\$NODENAME/g\" /root/patroni.yml

    # replace MYIP with imported variable IP
    /usr/bin/sed -i .orig \"/MYIP/s/MYIP/\$IP/g\" /root/patroni.yml

    # replace SERVICETAG with imported variable SERVICETAG
    /usr/bin/sed -i .orig \"/SERVICETAG/s/SERVICETAG/\$SERVICETAG/g\" /root/patroni.yml

    # replace CONSULIP with imported variable IP, as using local consul agent
    /usr/bin/sed -i .orig \"/CONSULIP/s/CONSULIP/\$IP/g\" /root/patroni.yml

    # replace ADMPASS with imported variable ADMPASS
    /usr/bin/sed -i .orig \"/ADMPASS/s/ADMPASS/\$ADMPASS/g\" /root/patroni.yml

    # replace KEKPASS with imported variable KEKPASS
    /usr/bin/sed -i .orig \"/KEKPASS/s/KEKPASS/\$KEKPASS/g\" /root/patroni.yml
fi

# create /usr/local/etc/patroni/
mkdir -p /usr/local/etc/patroni/

# copy the file to startup location
cp /root/patroni.yml /usr/local/etc/patroni/patroni.yml

# copy patroni startup script to /usr/local/etc/rc.d/
cp /root/patroni.rc /usr/local/etc/rc.d/patroni

# enable postgresql
sysrc postgresql_enable=\"YES\"

# enable patroni
sysrc patroni_enable=\"YES\"

# ensure permissions are good for /var/db/postgres mount-in
chown -R postgres:postgres /var/db/postgres

# end postgresql

# ADJUST THIS: START THE SERVICES AGAIN AFTER CONFIGURATION

# start consul agent
/usr/local/etc/rc.d/consul start

# start node_exporter
/usr/local/etc/rc.d/node_exporter start

# start patroni, which should start postgresql
/usr/local/etc/rc.d/patroni start

#
# Do not touch this:
touch /usr/local/etc/pot-is-seasoned

# If this pot flavour is blocking (i.e. it should not return), there is no /tmp/environment.sh
# created by pot and we now after configuration block indefinitely
if [ \"\$RUNS_IN_NOMAD\" = \"true\" ]
then
    /bin/sh /etc/rc
    tail -f /dev/null
fi
" > /usr/local/bin/cook

# ----------------- END COOK ------------------


# ---------- NO NEED TO EDIT BELOW ------------

step "Make cook script executable"
if [ -e /usr/local/bin/cook ]
then
    echo "setting executable bit on /usr/local/bin/cook" | tee -a $COOKLOG
    chmod u+x /usr/local/bin/cook
else
    exit_error "there is no /usr/local/bin/cook to make executable"
fi

#
# There are two ways of running a pot jail: "Normal", non-blocking mode and
# "Nomad", i.e. blocking mode (the pot start command does not return until
# the jail is stopped).
# For the normal mode, we create a /usr/local/etc/rc.d script that starts
# the "cook" script generated above each time, for the "Nomad" mode, the cook
# script is started by pot (configuration through flavour file), therefore
# we do not need to do anything here.
#

# Create rc.d script for "normal" mode:
step "Create rc.d script to start cook"
echo "creating rc.d script to start cook" | tee -a $COOKLOG

echo "#!/bin/sh
#
# PROVIDE: cook
# REQUIRE: LOGIN
# KEYWORD: shutdown
#
. /etc/rc.subr
name=\"cook\"
rcvar=\"cook_enable\"
load_rc_config \$name
: \${cook_enable:=\"NO\"}
: \${cook_env:=\"\"}
command=\"/usr/local/bin/cook\"
command_args=\"\"
run_rc_command \"\$1\"
" > /usr/local/etc/rc.d/cook

step "Make rc.d script to start cook executable"
if [ -e /usr/local/etc/rc.d/cook ]
then
  echo "Setting executable bit on cook rc file" | tee -a $COOKLOG
  chmod u+x /usr/local/etc/rc.d/cook
else
  exit_error "/usr/local/etc/rc.d/cook does not exist"
fi

if [ "$RUNS_IN_NOMAD" != "true" ]
then
  step "Enable cook service"
  # This is a non-nomad (non-blocking) jail, so we need to make sure the script
  # gets started when the jail is started:
  # Otherwise, /usr/local/bin/cook will be set as start script by the pot flavour
  echo "enabling cook" | tee -a $COOKLOG
  service cook enable
fi

# -------------------- DONE ---------------
exit_ok

postgresql-patroni/postgresql-patroni+1:
postgresql-patroni/postgresql-patroni+1.sh:

postgresql-patroni/postgresql-patroni+2:
postgresql-patroni/postgresql-patroni+2.sh:

postgresql-patroni/postgresql-patroni+3:
postgresql-patroni/postgresql-patroni+3.sh:

postgresql-patroni/postgresql-patroni+4:
postgresql-patroni/postgresql-patroni+4.sh:
Password:===>  Creating a new pot
===>  pot name : postgresql-patroni-amd64-12_2
===>  type : single
===>  base : 12.2
===>  pot_base :
===>  level : 0
===>  network-type : public-bridge
===>  network-stack: ipv4
===>  ip : 10.192.0.4
===>  bridge :
===>  dns : inherit
===>  flavours : fbsd-update postgresql-patroni postgresql-patroni+1 postgresql-patroni+2 postgresql-patroni+3 postgresql-patroni+4
===>  Fetching FreeBSD 12.2
===>  Extract the tarball
=====>  Flavour: fbsd-update
=====>  Starting postgresql-patroni-amd64-12_2 pot for the initial bootstrap
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
defaultrouter: NO -> 10.192.0.1
===>  Starting the pot postgresql-patroni-amd64-12_2
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
	inet 127.0.0.1 netmask 0xff000000
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:5a:87:aa:6e:0b
	inet 10.192.0.4 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Generating host.conf.
Creating and/or trimming log files.
Starting syslogd.
Clearing /tmp (X related).
Updating motd:.
Updating /var/run/os-release done.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.

Sun May 30 14:23:06 UTC 2021
/usr/local/etc/pot/flavours/fbsd-update.sh -> /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp/fbsd-update.sh
=====>  Executing fbsd-update script on postgresql-patroni-amd64-12_2
src component not installed, skipped
Looking up update.FreeBSD.org mirrors... 2 mirrors found.
Fetching public key from update2.freebsd.org... done.
Fetching metadata signature for 12.2-RELEASE from update2.freebsd.org... done.
Fetching metadata index... done.
Fetching 2 metadata files... done.
Inspecting system... done.
Preparing to download files... done.
Fetching 75 patches.....10....20....30....40....50....60....70.. done.
Applying patches... done.
Fetching 1 files...  done.
The following files will be removed as part of updating to
12.2-RELEASE-p7:
/etc/ssl/certs/2c543cd1.0
/etc/ssl/certs/2e4eed3c.0
/etc/ssl/certs/480720ec.0
/etc/ssl/certs/7d0b38bd.0
/etc/ssl/certs/8867006a.0
/etc/ssl/certs/ad088e1d.0
/etc/ssl/certs/b204d74a.0
/etc/ssl/certs/ba89ed3b.0
/etc/ssl/certs/c089bbbd.0
/etc/ssl/certs/e2799e36.0
/usr/share/certs/trusted/GeoTrust_Global_CA.pem
/usr/share/certs/trusted/GeoTrust_Primary_Certification_Authority.pem
/usr/share/certs/trusted/GeoTrust_Primary_Certification_Authority_-_G3.pem
/usr/share/certs/trusted/GeoTrust_Universal_CA.pem
/usr/share/certs/trusted/GeoTrust_Universal_CA_2.pem
/usr/share/certs/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem
/usr/share/certs/trusted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem
/usr/share/certs/trusted/thawte_Primary_Root_CA.pem
/usr/share/certs/trusted/thawte_Primary_Root_CA_-_G2.pem
/usr/share/certs/trusted/thawte_Primary_Root_CA_-_G3.pem
The following files will be added as part of updating to
12.2-RELEASE-p7:
/etc/ssl/blacklisted/2c543cd1.0
/etc/ssl/blacklisted/2e4eed3c.0
/etc/ssl/blacklisted/480720ec.0
/etc/ssl/blacklisted/7d0b38bd.0
/etc/ssl/blacklisted/8867006a.0
/etc/ssl/blacklisted/ad088e1d.0
/etc/ssl/blacklisted/b204d74a.0
/etc/ssl/blacklisted/ba89ed3b.0
/etc/ssl/blacklisted/c089bbbd.0
/etc/ssl/blacklisted/e2799e36.0
/etc/ssl/certs/3fb36b73.0
/usr/share/certs/blacklisted/GeoTrust_Global_CA.pem
/usr/share/certs/blacklisted/GeoTrust_Primary_Certification_Authority.pem
/usr/share/certs/blacklisted/GeoTrust_Primary_Certification_Authority_-_G3.pem
/usr/share/certs/blacklisted/GeoTrust_Universal_CA.pem
/usr/share/certs/blacklisted/GeoTrust_Universal_CA_2.pem
/usr/share/certs/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem
/usr/share/certs/blacklisted/VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem
/usr/share/certs/blacklisted/thawte_Primary_Root_CA.pem
/usr/share/certs/blacklisted/thawte_Primary_Root_CA_-_G2.pem
/usr/share/certs/blacklisted/thawte_Primary_Root_CA_-_G3.pem
/usr/share/certs/trusted/NAVER_Global_Root_Certification_Authority.pem
The following files will be updated as part of updating to
12.2-RELEASE-p7:
/bin/freebsd-version
/lib/libcrypto.so.111
/lib/libzfs.so.3
/lib/libzfs_core.so.2
/lib/libzpool.so.2
/rescue/[
/rescue/bectl
/rescue/bsdlabel
/rescue/bunzip2
/rescue/bzcat
/rescue/bzip2
/rescue/camcontrol
/rescue/cat
/rescue/ccdconfig
/rescue/chflags
/rescue/chgrp
/rescue/chio
/rescue/chmod
/rescue/chown
/rescue/chroot
/rescue/clri
/rescue/cp
/rescue/csh
/rescue/date
/rescue/dd
/rescue/devfs
/rescue/df
/rescue/dhclient
/rescue/disklabel
/rescue/dmesg
/rescue/dump
/rescue/dumpfs
/rescue/dumpon
/rescue/echo
/rescue/ed
/rescue/ex
/rescue/expr
/rescue/fastboot
/rescue/fasthalt
/rescue/fdisk
/rescue/fsck
/rescue/fsck_4.2bsd
/rescue/fsck_ffs
/rescue/fsck_msdosfs
/rescue/fsck_ufs
/rescue/fsdb
/rescue/fsirand
/rescue/gbde
/rescue/geom
/rescue/getfacl
/rescue/glabel
/rescue/gpart
/rescue/groups
/rescue/gunzip
/rescue/gzcat
/rescue/gzip
/rescue/halt
/rescue/head
/rescue/hostname
/rescue/id
/rescue/ifconfig
/rescue/init
/rescue/ipf
/rescue/iscsictl
/rescue/iscsid
/rescue/kenv
/rescue/kill
/rescue/kldconfig
/rescue/kldload
/rescue/kldstat
/rescue/kldunload
/rescue/ldconfig
/rescue/less
/rescue/link
/rescue/ln
/rescue/ls
/rescue/lzcat
/rescue/lzma
/rescue/md5
/rescue/mdconfig
/rescue/mdmfs
/rescue/mkdir
/rescue/mknod
/rescue/more
/rescue/mount
/rescue/mount_cd9660
/rescue/mount_msdosfs
/rescue/mount_nfs
/rescue/mount_nullfs
/rescue/mount_udf
/rescue/mount_unionfs
/rescue/mt
/rescue/mv
/rescue/nc
/rescue/newfs
/rescue/newfs_msdos
/rescue/nos-tun
/rescue/pgrep
/rescue/ping
/rescue/ping6
/rescue/pkill
/rescue/poweroff
/rescue/ps
/rescue/pwd
/rescue/rcorder
/rescue/rdump
/rescue/realpath
/rescue/reboot
/rescue/red
/rescue/rescue
/rescue/restore
/rescue/rm
/rescue/rmdir
/rescue/route
/rescue/routed
/rescue/rrestore
/rescue/rtquery
/rescue/rtsol
/rescue/savecore
/rescue/sed
/rescue/setfacl
/rescue/sh
/rescue/shutdown
/rescue/sleep
/rescue/spppcontrol
/rescue/stty
/rescue/swapon
/rescue/sync
/rescue/sysctl
/rescue/tail
/rescue/tar
/rescue/tcsh
/rescue/tee
/rescue/test
/rescue/tunefs
/rescue/umount
/rescue/unlink
/rescue/unlzma
/rescue/unxz
/rescue/unzstd
/rescue/vi
/rescue/whoami
/rescue/xz
/rescue/xzcat
/rescue/zcat
/rescue/zdb
/rescue/zfs
/rescue/zpool
/rescue/zstd
/rescue/zstdcat
/rescue/zstdmt
/sbin/ipfw
/sbin/rtsol
/sbin/zpool
/usr/bin/lldb
/usr/bin/zinject
/usr/bin/ztest
/usr/include/net/if_var.h
/usr/include/openssl/asn1err.h
/usr/include/sys/filedesc.h
/usr/include/sys/jail.h
/usr/lib/libcrypto.a
/usr/lib/libcrypto_p.a
/usr/lib/libpam.a
/usr/lib/libradius.a
/usr/lib/libradius.so.4
/usr/lib/libradius_p.a
/usr/lib/libssl.a
/usr/lib/libssl.so.111
/usr/lib/libssl_p.a
/usr/lib/libzfs.a
/usr/lib/libzfs_core.a
/usr/lib/libzfs_core_p.a
/usr/lib/libzfs_p.a
/usr/lib/libzpool.a
/usr/lib/pam_login_access.so.6
/usr/sbin/freebsd-update
/usr/sbin/rtsold
/usr/sbin/zdb
/usr/sbin/zfsd
/usr/sbin/zhack
/usr/share/man/man2/jail.2.gz
/usr/share/man/man2/jail_attach.2.gz
/usr/share/man/man2/jail_get.2.gz
/usr/share/man/man2/jail_remove.2.gz
/usr/share/man/man2/jail_set.2.gz
/usr/share/zoneinfo/Africa/Accra
/usr/share/zoneinfo/Africa/Addis_Ababa
/usr/share/zoneinfo/Africa/Algiers
/usr/share/zoneinfo/Africa/Asmara
/usr/share/zoneinfo/Africa/Asmera
/usr/share/zoneinfo/Africa/Bangui
/usr/share/zoneinfo/Africa/Brazzaville
/usr/share/zoneinfo/Africa/Casablanca
/usr/share/zoneinfo/Africa/Dar_es_Salaam
/usr/share/zoneinfo/Africa/Djibouti
/usr/share/zoneinfo/Africa/Douala
/usr/share/zoneinfo/Africa/El_Aaiun
/usr/share/zoneinfo/Africa/Juba
/usr/share/zoneinfo/Africa/Kampala
/usr/share/zoneinfo/Africa/Kinshasa
/usr/share/zoneinfo/Africa/Lagos
/usr/share/zoneinfo/Africa/Libreville
/usr/share/zoneinfo/Africa/Luanda
/usr/share/zoneinfo/Africa/Malabo
/usr/share/zoneinfo/Africa/Mogadishu
/usr/share/zoneinfo/Africa/Nairobi
/usr/share/zoneinfo/Africa/Niamey
/usr/share/zoneinfo/Africa/Porto-Novo
/usr/share/zoneinfo/America/Belize
/usr/share/zoneinfo/America/Dawson
/usr/share/zoneinfo/America/Grand_Turk
/usr/share/zoneinfo/America/Nassau
/usr/share/zoneinfo/America/Whitehorse
/usr/share/zoneinfo/Antarctica/Casey
/usr/share/zoneinfo/Antarctica/Macquarie
/usr/share/zoneinfo/Asia/Gaza
/usr/share/zoneinfo/Asia/Hebron
/usr/share/zoneinfo/Asia/Jerusalem
/usr/share/zoneinfo/Asia/Tel_Aviv
/usr/share/zoneinfo/Atlantic/Bermuda
/usr/share/zoneinfo/Australia/ACT
/usr/share/zoneinfo/Australia/Adelaide
/usr/share/zoneinfo/Australia/Brisbane
/usr/share/zoneinfo/Australia/Broken_Hill
/usr/share/zoneinfo/Australia/Canberra
/usr/share/zoneinfo/Australia/Currie
/usr/share/zoneinfo/Australia/Darwin
/usr/share/zoneinfo/Australia/Eucla
/usr/share/zoneinfo/Australia/Hobart
/usr/share/zoneinfo/Australia/Lindeman
/usr/share/zoneinfo/Australia/Melbourne
/usr/share/zoneinfo/Australia/NSW
/usr/share/zoneinfo/Australia/North
/usr/share/zoneinfo/Australia/Perth
/usr/share/zoneinfo/Australia/Queensland
/usr/share/zoneinfo/Australia/South
/usr/share/zoneinfo/Australia/Sydney
/usr/share/zoneinfo/Australia/Tasmania
/usr/share/zoneinfo/Australia/Victoria
/usr/share/zoneinfo/Australia/West
/usr/share/zoneinfo/Australia/Yancowinna
/usr/share/zoneinfo/Canada/Yukon
/usr/share/zoneinfo/Europe/Budapest
/usr/share/zoneinfo/Europe/Monaco
/usr/share/zoneinfo/Europe/Paris
/usr/share/zoneinfo/Europe/Volgograd
/usr/share/zoneinfo/Indian/Antananarivo
/usr/share/zoneinfo/Indian/Comoro
/usr/share/zoneinfo/Indian/Mahe
/usr/share/zoneinfo/Indian/Mayotte
/usr/share/zoneinfo/Israel
/usr/share/zoneinfo/Pacific/Efate
/usr/share/zoneinfo/Pacific/Fiji
/usr/share/zoneinfo/zone.tab
/usr/share/zoneinfo/zone1970.tab
Installing updates...Scanning //usr/share/certs/blacklisted for certificates...
Scanning //usr/share/certs/trusted for certificates...
 done.
=====>  Stop the pot postgresql-patroni-amd64-12_2
=====>  Remove epair0[a|b] network interfaces
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/dev
=====>  Flavour: postgresql-patroni
=====>  Executing postgresql-patroni pot commands on postgresql-patroni-amd64-12_2
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
/usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.rc -> /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/root/patroni.rc
=====>  Source /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.rc copied in the pot postgresql-patroni-amd64-12_2
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
=====>  /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/dev is already unmounted
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
/usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.yml -> /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/root/patroni.yml
=====>  Source /usr/local/etc/pot/flavours/postgresql-patroni.d/patroni.yml copied in the pot postgresql-patroni-amd64-12_2
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
=====>  /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/dev is already unmounted
=====>  Starting postgresql-patroni-amd64-12_2 pot for the initial bootstrap
=====>  mount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
defaultrouter: 10.192.0.1 -> 10.192.0.1
===>  Starting the pot postgresql-patroni-amd64-12_2
ELF ldconfig path: /lib /usr/lib /usr/lib/compat
32-bit compatibility ldconfig path: /usr/lib32
Starting Network: lo0 epair0b.
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
	options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
	inet6 ::1 prefixlen 128
	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
	inet 127.0.0.1 netmask 0xff000000
	groups: lo
	nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
	options=8<VLAN_MTU>
	ether 02:65:52:6b:1c:0b
	inet 10.192.0.4 netmask 0xffc00000 broadcast 10.255.255.255
	groups: epair
	media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
	status: active
	nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
add host 127.0.0.1: gateway lo0 fib 0: route already in table
add net default: gateway 10.192.0.1
add host ::1: gateway lo0 fib 0: route already in table
add net fe80::: gateway ::1
add net ff02::: gateway ::1
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
Creating and/or trimming log files.
Starting syslogd.
Clearing /tmp (X related).
Updating motd:.
Updating /var/run/os-release done.
Starting sendmail_submit.
Starting sendmail_msp_queue.
Starting cron.

Sun May 30 14:24:27 UTC 2021
/usr/local/etc/pot/flavours/postgresql-patroni.sh -> /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp/postgresql-patroni.sh
=====>  Executing postgresql-patroni script on postgresql-patroni-amd64-12_2
Creating /var/log/cook.log
Step 1: Bootstrap package repo
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] Installing pkg-1.16.3...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] Extracting pkg-1.16.3: .......... done
Bootstrapping pkg from pkg+http://pkg.FreeBSD.org/FreeBSD:12:amd64/quarterly, please wait...
Step 2: Touch /etc/rc.conf
Step 3: Remove ifconfig_epair0b from config
Step 4: Disable sendmail
sendmail disabled in /etc/rc.conf
sendmail_submit disabled in /etc/rc.conf
sendmail_msp_queue disabled in /etc/rc.conf
Step 5: Create /usr/local/etc/rc.d
Step 6: Update package repository
Updating FreeBSD repository catalogue...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] Fetching meta.conf: . done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] Fetching packagesite.txz: .......... done
Processing entries: .......... done
FreeBSD repository update completed. 30512 packages processed.
All repositories are up to date.
Step 7: Install package sudo
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Updating database digests format: . done
The following 3 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	gettext-runtime: 0.21
	indexinfo: 0.3.1
	sudo: 1.9.6p1

Number of packages to be installed: 3

The process will require 7 MiB more space.
1 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/3] Fetching sudo-1.9.6p1.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/3] Fetching gettext-runtime-0.21.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/3] Fetching indexinfo-0.3.1.txz: . done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/3] Installing indexinfo-0.3.1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/3] Extracting indexinfo-0.3.1: .... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/3] Installing gettext-runtime-0.21...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/3] Extracting gettext-runtime-0.21: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/3] Installing sudo-1.9.6p1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/3] Extracting sudo-1.9.6p1: .......... done
Step 8: Install package openssl
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	openssl: 1.1.1k_1,1

Number of packages to be installed: 1

The process will require 14 MiB more space.
4 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching openssl-1.1.1k_1,1.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Installing openssl-1.1.1k_1,1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting openssl-1.1.1k_1,1: .......... done
Step 9: Install package vault
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	vault: 1.6.3

Number of packages to be installed: 1

The process will require 138 MiB more space.
45 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching vault-1.6.3.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Installing vault-1.6.3...
===> Creating groups.
Creating group 'vault' with gid '471'.
===> Creating users
Creating user 'vault' with uid '471'.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting vault-1.6.3: ..... done
=====
Message from vault-1.6.3:

--
The vault user created by the vault package is now a member of the daemon
class, which will allow it to use mlock() when started by the rc script. This
will not be reflected in systems where the user already exists. Please add the
vault user to the daemon class manually by running:

pw usermod -L daemon -n vault

or delete the user and reinstall the package.

You may also need to increase memorylocked for the daemon class in
/etc/login.conf to 1024M or more and run:

cap_mkdb /etc/login.conf

Or to disable mlock, add:

disable_mlock = 1

to /usr/local/etc/vault.hcl
Step 10: Install package consul
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	consul: 1.9.4

Number of packages to be installed: 1

The process will require 78 MiB more space.
27 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching consul-1.9.4.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Installing consul-1.9.4...
===> Creating groups.
Creating group 'consul' with gid '469'.
===> Creating users
Creating user 'consul' with uid '469'.
===> Creating homedir(s)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting consul-1.9.4: ..... done
Step 11: Install package node_exporter
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 1 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	node_exporter: 1.1.2

Number of packages to be installed: 1

The process will require 11 MiB more space.
3 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Fetching node_exporter-1.1.2.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Installing node_exporter-1.1.2...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/1] Extracting node_exporter-1.1.2: .......... done
=====
Message from node_exporter-1.1.2:

--
If upgrading from a version of node_exporter <0.15.0 you'll need to update any
custom command line flags that you may have set as it now requires a
double-dash (--flag) instead of a single dash (-flag).
The collector flags in 0.15.0 have now been replaced with individual boolean
flags and the -collector.procfs` and -collector.sysfs` flags have been renamed
to --path.procfs and --path.sysfs respectively.
Step 12: Install package postgresql-client
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	postgresql13-client: 13.3
	readline: 8.1.0

Number of packages to be installed: 2

The process will require 14 MiB more space.
3 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching postgresql13-client-13.3.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching readline-8.1.0.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/2] Installing readline-8.1.0...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting readline-8.1.0: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/2] Installing postgresql13-client-13.3...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting postgresql13-client-13.3: .......... done
=====
Message from postgresql13-client-13.3:

--
The PostgreSQL port has a collection of "side orders":

postgresql-docs
  For all of the html documentation

p5-Pg
  A perl5 API for client access to PostgreSQL databases.

postgresql-tcltk 
  If you want tcl/tk client support.

postgresql-jdbc
  For Java JDBC support.

postgresql-odbc
  For client access from unix applications using ODBC as access
  method. Not needed to access unix PostgreSQL servers from Win32
  using ODBC. See below.

ruby-postgres, py-psycopg2
  For client access to PostgreSQL databases using the ruby & python
  languages.

postgresql-plperl, postgresql-pltcl & postgresql-plruby
  For using perl5, tcl & ruby as procedural languages.

postgresql-contrib
  Lots of contributed utilities, postgresql functions and
  datatypes. There you find pg_standby, pgcrypto and many other cool
  things.

etc...
Step 13: Install package postgresql-server
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 9 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	icu: 68.2,1
	libedit: 3.1.20210216,1
	libffi: 3.3_1
	libxml2: 2.9.10_4
	llvm10: 10.0.1_5
	lua52: 5.2.4
	perl5: 5.32.1_1
	postgresql13-server: 13.3
	python37: 3.7.10

Number of packages to be installed: 9

The process will require 912 MiB more space.
152 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/9] Fetching postgresql13-server-13.3.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/9] Fetching llvm10-10.0.1_5.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/9] Fetching libxml2-2.9.10_4.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/9] Fetching python37-3.7.10.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [5/9] Fetching libffi-3.3_1.txz: ..... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [6/9] Fetching perl5-5.32.1_1.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [7/9] Fetching lua52-5.2.4.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [8/9] Fetching libedit-3.1.20210216,1.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [9/9] Fetching icu-68.2,1.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/9] Installing libffi-3.3_1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/9] Extracting libffi-3.3_1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/9] Installing libedit-3.1.20210216,1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/9] Extracting libedit-3.1.20210216,1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/9] Installing libxml2-2.9.10_4...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/9] Extracting libxml2-2.9.10_4: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/9] Installing python37-3.7.10...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/9] Extracting python37-3.7.10: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [5/9] Installing perl5-5.32.1_1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [5/9] Extracting perl5-5.32.1_1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [6/9] Installing lua52-5.2.4...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [6/9] Extracting lua52-5.2.4: ......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [7/9] Installing llvm10-10.0.1_5...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [7/9] Extracting llvm10-10.0.1_5: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [8/9] Installing icu-68.2,1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [8/9] Extracting icu-68.2,1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [9/9] Installing postgresql13-server-13.3...
===> Creating groups.
Creating group 'postgres' with gid '770'.
===> Creating users
Creating user 'postgres' with uid '770'.
===> Creating homedir(s)

  =========== BACKUP YOUR DATA! =============
  As always, backup your data before
  upgrading. If the upgrade leads to a higher
  major revision (e.g. 9.6 -> 10), a dump
  and restore of all databases is
  required. This is *NOT* done by the port!
  See https://www.postgresql.org/docs/current/upgrading.html
  ===========================================
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [9/9] Extracting postgresql13-server-13.3: .......... done
=====
Message from python37-3.7.10:

--
Note that some standard Python modules are provided as separate ports
as they require additional dependencies. They are available as:

py37-gdbm       databases/py-gdbm@py37
py37-sqlite3    databases/py-sqlite3@py37
py37-tkinter    x11-toolkits/py-tkinter@py37
=====
Message from postgresql13-server-13.3:

--
For procedural languages and postgresql functions, please note that
you might have to update them when updating the server.

If you have many tables and many clients running, consider raising
kern.maxfiles using sysctl(8), or reconfigure your kernel
appropriately.

The port is set up to use autovacuum for new databases, but you might
also want to vacuum and perhaps backup your database regularly. There
is a periodic script, /usr/local/etc/periodic/daily/502.pgsql, that
you may find useful. You can use it to backup and perform vacuum on all
databases nightly. Per default, it performs `vacuum analyze'. See the
script for instructions. For autovacuum settings, please review
~postgres/data/postgresql.conf.

If you plan to access your PostgreSQL server using ODBC, please
consider running the SQL script /usr/local/share/postgresql/odbc.sql
to get the functions required for ODBC compliance.

Please note that if you use the rc script,
/usr/local/etc/rc.d/postgresql, to initialize the database, unicode
(UTF-8) will be used to store character data by default.  Set
postgresql_initdb_flags or use login.conf settings described below to
alter this behaviour. See the start rc script for more info.

To set limits, environment stuff like locale and collation and other
things, you can set up a class in /etc/login.conf before initializing
the database. Add something similar to this to /etc/login.conf:
---
postgres:\
	:lang=en_US.UTF-8:\
	:setenv=LC_COLLATE=C:\
	:tc=default:
---
and run `cap_mkdb /etc/login.conf'.
Then add 'postgresql_class="postgres"' to /etc/rc.conf.

======================================================================

To initialize the database, run

  /usr/local/etc/rc.d/postgresql initdb

You can then start PostgreSQL by running:

  /usr/local/etc/rc.d/postgresql start

For postmaster settings, see ~postgres/data/postgresql.conf

NB. FreeBSD's PostgreSQL port logs to syslog by default
    See ~postgres/data/postgresql.conf for more info

NB. If you're not using a checksumming filesystem like ZFS, you might
    wish to enable data checksumming. It can be enabled during
    the initdb phase, by adding the "--data-checksums" flag to
    the postgresql_initdb_flags rcvar. Otherwise you can enable it later by
    pg_checksums.  Check the initdb(1) manpage for more info
    and make sure you understand the performance implications.

======================================================================

To run PostgreSQL at startup, add
'postgresql_enable="YES"' to /etc/rc.conf
Step 14: Install package python37
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
Checking integrity... done (0 conflicting)
The most recent versions of packages are already installed
Step 15: Install package python3-pip
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py37-pip: 20.2.3
	py37-setuptools: 44.0.0

Number of packages to be installed: 2

The process will require 16 MiB more space.
2 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching py37-pip-20.2.3.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching py37-setuptools-44.0.0.txz: .......... done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/2] Installing py37-setuptools-44.0.0...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/2] Extracting py37-setuptools-44.0.0: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/2] Installing py37-pip-20.2.3...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/2] Extracting py37-pip-20.2.3: .......... done
=====
Message from py37-pip-20.2.3:

--
pip MUST ONLY be used:

 * With the --user flag, OR
 * To install or manage Python packages in virtual environments

Failure to follow this warning can and will result in an inconsistent
system-wide Python environment (LOCALBASE/lib/pythonX.Y/site-packages) and
cause errors.

Avoid using pip as root unless you know what you're doing.
Step 16: Install package python-consul2
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 12 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	py37-certifi: 2020.12.5
	py37-cffi: 1.14.5
	py37-chardet: 3.0.4_3,1
	py37-cryptography: 3.3.2
	py37-idna: 2.10
	py37-openssl: 20.0.1
	py37-pycparser: 2.20
	py37-pysocks: 1.7.1
	py37-python-consul2: 0.1.5
	py37-requests: 2.25.1
	py37-six: 1.15.0
	py37-urllib3: 1.25.11,1

Number of packages to be installed: 12

The process will require 9 MiB more space.
1 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/12] Fetching py37-python-consul2-0.1.5.txz: ...... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/12] Fetching py37-requests-2.25.1.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/12] Fetching py37-chardet-3.0.4_3,1.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/12] Fetching py37-certifi-2020.12.5.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [5/12] Fetching py37-urllib3-1.25.11,1.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [6/12] Fetching py37-openssl-20.0.1.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [7/12] Fetching py37-cryptography-3.3.2.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [8/12] Fetching py37-six-1.15.0.txz: ... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [9/12] Fetching py37-cffi-1.14.5.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [10/12] Fetching py37-pycparser-2.20.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [11/12] Fetching py37-pysocks-1.7.1.txz: ... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [12/12] Fetching py37-idna-2.10.txz: ........ done
Checking integrity... done (0 conflicting)
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/12] Installing py37-pycparser-2.20...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/12] Extracting py37-pycparser-2.20: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/12] Installing py37-six-1.15.0...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/12] Extracting py37-six-1.15.0: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/12] Installing py37-cffi-1.14.5...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/12] Extracting py37-cffi-1.14.5: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/12] Installing py37-cryptography-3.3.2...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/12] Extracting py37-cryptography-3.3.2: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [5/12] Installing py37-certifi-2020.12.5...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [5/12] Extracting py37-certifi-2020.12.5: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [6/12] Installing py37-openssl-20.0.1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [6/12] Extracting py37-openssl-20.0.1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [7/12] Installing py37-pysocks-1.7.1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [7/12] Extracting py37-pysocks-1.7.1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [8/12] Installing py37-idna-2.10...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [8/12] Extracting py37-idna-2.10: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [9/12] Installing py37-chardet-3.0.4_3,1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [9/12] Extracting py37-chardet-3.0.4_3,1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [10/12] Installing py37-urllib3-1.25.11,1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [10/12] Extracting py37-urllib3-1.25.11,1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [11/12] Installing py37-requests-2.25.1...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [11/12] Extracting py37-requests-2.25.1: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [12/12] Installing py37-python-consul2-0.1.5...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [12/12] Extracting py37-python-consul2-0.1.5: .......... done
=====
Message from py37-urllib3-1.25.11,1:

--
Since version 1.25 HTTPS connections are now verified by default which is done
via "cert_reqs = 'CERT_REQUIRED'".  While certificate verification can be
disabled via "cert_reqs = 'CERT_NONE'", it's highly recommended to leave it on.

Various consumers of net/py-urllib3 already have implemented routines that
either explicitly enable or disable HTTPS certificate verification (e.g. via
configuration settings, CLI arguments, etc.).

Yet it may happen that there are still some consumers which don't explicitly
enable/disable certificate verification for HTTPS connections which could then
lead to errors (as is often the case with self-signed certificates).

In case of an error one should try first to temporarily disable certificate
verification of the problematic urllib3 consumer to see if that approach will
remedy the issue.
Step 17: Install package psycopg2
Updating FreeBSD repository catalogue...
FreeBSD repository is up to date.
All repositories are up to date.
The following 2 package(s) will be affected (of 0 checked):

New packages to be INSTALLED:
	postgresql12-client: 12.7
	py37-psycopg2: 2.8.6

Number of packages to be installed: 2

The process will require 13 MiB more space.
3 MiB to be downloaded.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/2] Fetching py37-psycopg2-2.8.6.txz: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/2] Fetching postgresql12-client-12.7.txz: .......... done
Checking integrity... done (2 conflicting)
  - postgresql12-client-12.7 conflicts with postgresql13-client-13.3 on /usr/local/bin/clusterdb
  - postgresql12-client-12.7 conflicts with postgresql13-client-13.3 on /usr/local/bin/clusterdb
Checking integrity... done (0 conflicting)
Conflicts with the existing packages have been found.
One more solver iteration is needed to resolve them.
The following 4 package(s) will be affected (of 0 checked):

Installed packages to be REMOVED:
	postgresql13-client: 13.3
	postgresql13-server: 13.3

New packages to be INSTALLED:
	postgresql12-client: 12.7
	py37-psycopg2: 2.8.6

Number of packages to be removed: 2
Number of packages to be installed: 2

The operation will free 41 MiB.
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/4] Deinstalling postgresql13-server-13.3...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [1/4] Deleting files for postgresql13-server-13.3: .......... done
==> You should manually remove the "postgres" user. 
==> You should manually remove the "postgres" group 
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/4] Deinstalling postgresql13-client-13.3...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [2/4] Deleting files for postgresql13-client-13.3: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/4] Installing postgresql12-client-12.7...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [3/4] Extracting postgresql12-client-12.7: .......... done
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/4] Installing py37-psycopg2-2.8.6...
[postgresql-patroni-amd64-12_2.vsf00001.cpt.za.honeyguide.net] [4/4] Extracting py37-psycopg2-2.8.6: .......... done
=====
Message from postgresql12-client-12.7:

--
The PostgreSQL port has a collection of "side orders":

postgresql-docs
  For all of the html documentation

p5-Pg
  A perl5 API for client access to PostgreSQL databases.

postgresql-tcltk 
  If you want tcl/tk client support.

postgresql-jdbc
  For Java JDBC support.

postgresql-odbc
  For client access from unix applications using ODBC as access
  method. Not needed to access unix PostgreSQL servers from Win32
  using ODBC. See below.

ruby-postgres, py-psycopg2
  For client access to PostgreSQL databases using the ruby & python
  languages.

postgresql-plperl, postgresql-pltcl & postgresql-plruby
  For using perl5, tcl & ruby as procedural languages.

postgresql-contrib
  Lots of contributed utilities, postgresql functions and
  datatypes. There you find pg_standby, pgcrypto and many other cool
  things.

etc...
Step 18: Install pip package patroni
Collecting patroni
  Downloading patroni-2.0.2-py3-none-any.whl (211 kB)
Collecting click>=4.1
  Downloading click-8.0.1-py3-none-any.whl (97 kB)
Requirement already satisfied: six>=1.7 in /usr/local/lib/python3.7/site-packages (from patroni) (1.15.0)
Collecting PyYAML
  Downloading PyYAML-5.4.1.tar.gz (175 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Collecting python-dateutil
  Downloading python_dateutil-2.8.1-py2.py3-none-any.whl (227 kB)
Collecting ydiff>=1.2.0
  Downloading ydiff-1.2.tar.gz (42 kB)
Collecting prettytable>=0.7
  Downloading prettytable-2.1.0-py3-none-any.whl (22 kB)
Requirement already satisfied: urllib3!=1.21,>=1.19.1 in /usr/local/lib/python3.7/site-packages (from patroni) (1.25.11)
Collecting psutil>=2.0.0
  Downloading psutil-5.8.0.tar.gz (470 kB)
Collecting importlib-metadata; python_version < "3.8"
  Downloading importlib_metadata-4.3.1-py3-none-any.whl (16 kB)
Collecting wcwidth
  Downloading wcwidth-0.2.5-py2.py3-none-any.whl (30 kB)
Collecting zipp>=0.5
  Downloading zipp-3.4.1-py3-none-any.whl (5.2 kB)
Collecting typing-extensions>=3.6.4; python_version < "3.8"
  Downloading typing_extensions-3.10.0.0-py3-none-any.whl (26 kB)
Using legacy 'setup.py install' for ydiff, since package 'wheel' is not installed.
Using legacy 'setup.py install' for psutil, since package 'wheel' is not installed.
Building wheels for collected packages: PyYAML
  Building wheel for PyYAML (PEP 517): started
  Building wheel for PyYAML (PEP 517): finished with status 'done'
  Created wheel for PyYAML: filename=PyYAML-5.4.1-cp37-cp37m-freebsd_12_2_release_p7_amd64.whl size=45670 sha256=737256c3cbb49f36ecb6260a89d634fd556a304682d7e47da4e5b18bec24fcff
  Stored in directory: /root/.cache/pip/wheels/f4/51/cc/858604f7bb9cab887106ff266a541546ad783b4fa20875051d
Successfully built PyYAML
Installing collected packages: zipp, typing-extensions, importlib-metadata, click, PyYAML, python-dateutil, ydiff, wcwidth, prettytable, psutil, patroni
    Running setup.py install for ydiff: started
    Running setup.py install for ydiff: finished with status 'done'
    Running setup.py install for psutil: started
    Running setup.py install for psutil: finished with status 'done'
Successfully installed PyYAML-5.4.1 click-8.0.1 importlib-metadata-4.3.1 patroni-2.0.2 prettytable-2.1.0 psutil-5.8.0 python-dateutil-2.8.1 typing-extensions-3.10.0.0 wcwidth-0.2.5 ydiff-1.2 zipp-3.4.1
Step 19: Clean package installation
The following package files will be deleted:
	/var/cache/pkg/readline-8.1.0.txz
	/var/cache/pkg/gettext-runtime-0.21~7f53ebc469.txz
	/var/cache/pkg/perl5-5.32.1_1.txz
	/var/cache/pkg/icu-68.2,1.txz
	/var/cache/pkg/libedit-3.1.20210216,1~a678bd7bbc.txz
	/var/cache/pkg/libedit-3.1.20210216,1.txz
	/var/cache/pkg/py37-pysocks-1.7.1.txz
	/var/cache/pkg/postgresql13-server-13.3~a027196c08.txz
	/var/cache/pkg/libffi-3.3_1~d917da3d3d.txz
	/var/cache/pkg/py37-chardet-3.0.4_3,1.txz
	/var/cache/pkg/postgresql12-client-12.7.txz
	/var/cache/pkg/lua52-5.2.4.txz
	/var/cache/pkg/sudo-1.9.6p1~723a9c61d7.txz
	/var/cache/pkg/py37-pycparser-2.20~6cbb89204a.txz
	/var/cache/pkg/gettext-runtime-0.21.txz
	/var/cache/pkg/py37-pip-20.2.3.txz
	/var/cache/pkg/py37-setuptools-44.0.0~00f41c6435.txz
	/var/cache/pkg/py37-cryptography-3.3.2~be0de067b0.txz
	/var/cache/pkg/py37-six-1.15.0.txz
	/var/cache/pkg/openssl-1.1.1k_1,1.txz
	/var/cache/pkg/py37-idna-2.10.txz
	/var/cache/pkg/perl5-5.32.1_1~deac626516.txz
	/var/cache/pkg/py37-openssl-20.0.1.txz
	/var/cache/pkg/vault-1.6.3~3088e9df51.txz
	/var/cache/pkg/py37-cffi-1.14.5~a1ba5b0b9d.txz
	/var/cache/pkg/llvm10-10.0.1_5.txz
	/var/cache/pkg/python37-3.7.10~583f13c514.txz
	/var/cache/pkg/py37-urllib3-1.25.11,1.txz
	/var/cache/pkg/node_exporter-1.1.2~9a6778e31d.txz
	/var/cache/pkg/py37-psycopg2-2.8.6~fcb88298a6.txz
	/var/cache/pkg/py37-python-consul2-0.1.5.txz
	/var/cache/pkg/py37-openssl-20.0.1~ce7a48c3d7.txz
	/var/cache/pkg/openssl-1.1.1k_1,1~8a64387bd1.txz
	/var/cache/pkg/py37-idna-2.10~b6312ba191.txz
	/var/cache/pkg/lua52-5.2.4~d55d04708a.txz
	/var/cache/pkg/python37-3.7.10.txz
	/var/cache/pkg/libxml2-2.9.10_4.txz
	/var/cache/pkg/llvm10-10.0.1_5~45886e65a6.txz
	/var/cache/pkg/libffi-3.3_1.txz
	/var/cache/pkg/node_exporter-1.1.2.txz
	/var/cache/pkg/py37-requests-2.25.1.txz
	/var/cache/pkg/indexinfo-0.3.1~bd05368104.txz
	/var/cache/pkg/consul-1.9.4~6fa61d85b5.txz
	/var/cache/pkg/py37-requests-2.25.1~662e8b057d.txz
	/var/cache/pkg/py37-certifi-2020.12.5~7949440b0c.txz
	/var/cache/pkg/vault-1.6.3.txz
	/var/cache/pkg/postgresql13-client-13.3~4ec2ecccbe.txz
	/var/cache/pkg/py37-cryptography-3.3.2.txz
	/var/cache/pkg/indexinfo-0.3.1.txz
	/var/cache/pkg/py37-pip-20.2.3~2d7596cb25.txz
	/var/cache/pkg/py37-six-1.15.0~b04f63eaba.txz
	/var/cache/pkg/postgresql12-client-12.7~219480d066.txz
	/var/cache/pkg/py37-urllib3-1.25.11,1~a69976d0a9.txz
	/var/cache/pkg/icu-68.2,1~9e8b9bd090.txz
	/var/cache/pkg/consul-1.9.4.txz
	/var/cache/pkg/py37-psycopg2-2.8.6.txz
	/var/cache/pkg/py37-setuptools-44.0.0.txz
	/var/cache/pkg/postgresql13-client-13.3.txz
	/var/cache/pkg/sudo-1.9.6p1.txz
	/var/cache/pkg/py37-pycparser-2.20.txz
	/var/cache/pkg/py37-cffi-1.14.5.txz
	/var/cache/pkg/py37-python-consul2-0.1.5~e8274d4169.txz
	/var/cache/pkg/libxml2-2.9.10_4~0d72d43551.txz
	/var/cache/pkg/py37-chardet-3.0.4_3,1~2f9778dd23.txz
	/var/cache/pkg/readline-8.1.0~1be50603b8.txz
	/var/cache/pkg/py37-pysocks-1.7.1~bfc423ff5f.txz
	/var/cache/pkg/py37-certifi-2020.12.5.txz
	/var/cache/pkg/postgresql13-server-13.3.txz
The cleanup will free 242 MiB
Deleting files: .......... done
All done
Step 20: Remove pre-existing cook script (if any)
Step 21: Create cook script
Step 22: Make cook script executable
setting executable bit on /usr/local/bin/cook
Step 23: Create rc.d script to start cook
creating rc.d script to start cook
Step 24: Make rc.d script to start cook executable
Setting executable bit on cook rc file
Step 25: Enable cook service
enabling cook
cook enabled in /etc/rc.conf
=====>  Stop the pot postgresql-patroni-amd64-12_2
=====>  Remove epair0[a|b] network interfaces
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/tmp
=====>  unmount /mnt/data/pot/jails/postgresql-patroni-amd64-12_2/m/dev
=====>  Flavour: postgresql-patroni+1
=====>  Executing postgresql-patroni+1 pot commands on postgresql-patroni-amd64-12_2
=====>  No shell script available for the flavour postgresql-patroni+1
=====>  Flavour: postgresql-patroni+2
=====>  Executing postgresql-patroni+2 pot commands on postgresql-patroni-amd64-12_2
=====>  No shell script available for the flavour postgresql-patroni+2
=====>  Flavour: postgresql-patroni+3
=====>  Executing postgresql-patroni+3 pot commands on postgresql-patroni-amd64-12_2
=====>  No shell script available for the flavour postgresql-patroni+3
=====>  Flavour: postgresql-patroni+4
=====>  Executing postgresql-patroni+4 pot commands on postgresql-patroni-amd64-12_2
=====>  No shell script available for the flavour postgresql-patroni+4

This site © Honeyguide Group (Pty) Ltd, all the hosted software their respective license owners 2020 - 2021 - Disclaimer