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.
This commit is contained in:
2024-06-29 08:00:29 -05:00
parent d8472c64a2
commit 2ce211b5ea
4 changed files with 57 additions and 0 deletions

38
deploy/db0.sh Normal file
View File

@@ -0,0 +1,38 @@
#!/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