Files
configpolicy/deploy/db0.sh
Dustin C. Hatch 2ce211b5ea hosts: Add db0.p.b
*db0.pyrocufflink.blue* will be the primary server in the new PostgreSQL
database cluster.  We're starting with Fedora 39 so we can have
PostgreSQL 15, to match the version managed by the Postgres Operator in
the Kubernetes cluster right now.
2024-07-02 20:44:29 -05:00

39 lines
763 B
Bash

#!/bin/sh
# vim: set ts=4 :
if ! virsh list --all --name | grep -qF db0; then
./newvm.sh db0 \
--fedora 39 \
--memory 8192,currentMemory=2048 \
--vcpus 4 \
--no-console \
-- \
--disk pool=default,size=128,cache=none \
|| exit
sleep 15
fi
nameserver=$(
dig +short -t srv _ldap._tcp.pdc._msdcs.pyrocufflink.blue \
| awk '{print $4}'
) || exit
nsupdate -g <<EOF || exit
server ${nameserver%.}
delete postgresql.pyrocufflink.blue
add postgresql.pyrocufflink.blue 300 CNAME db0.pyrocufflink.blue.
send
EOF
ANSIBLE_HOST_KEY_CHECKING=false \
ansible-playbook \
-l db0.pyrocufflink.blue \
wait-for-host.yml \
bootstrap.yml \
datavol.yml \
pyrocufflink.yml \
postgresql.yml \
-u root \
-e ansible_host=db0.local \
-e @join.creds \
|| exit