From 010f652060107aa0167c688c8c615d218e36d470 Mon Sep 17 00:00:00 2001 From: "Dustin C. Hatch" Date: Sun, 13 Oct 2024 18:11:40 -0500 Subject: [PATCH] hosts: Add loki1.p.b _loki1.pyrocufflink.blue_ replaces _loki0.pyrocufflink.blue_. The former runs Fedora Linux and is managed by Ansible, while the latter ran Fedora CoreOS and was managed by Ignition and _cfg_. --- deploy/loki1.sh | 30 ++++++++++++++++++++++++++++ group_vars/vm-hosts.yml | 2 +- hosts | 2 ++ migration/loki0-to-loki1.sh | 40 +++++++++++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+), 1 deletion(-) create mode 100644 deploy/loki1.sh create mode 100644 migration/loki0-to-loki1.sh diff --git a/deploy/loki1.sh b/deploy/loki1.sh new file mode 100644 index 0000000..1fffbfd --- /dev/null +++ b/deploy/loki1.sh @@ -0,0 +1,30 @@ +#!/bin/sh +# vim: set ts=4 : + +if ! virsh list --all --name | grep -qF loki1; then + ./newvm.sh loki1 \ + --fedora 40 \ + --memory 4096,currentMemory=2048 \ + --vcpus 2 \ + --network network=prod,mac=52:54:00:51:3c:e9 \ + --no-console \ + -- \ + --disk pool=default,size=128,cache=none \ + || exit + sleep 15 +fi + +ANSIBLE_HOST_KEY_CHECKING=false \ +ansible-playbook \ + -l loki1.pyrocufflink.blue \ + wait-for-host.yml \ + bootstrap.yml \ + datavol.yml \ + pyrocufflink.yml \ + loki.yml \ + collectd.yml \ + promtail.yml \ + -u root \ + -e ansible_host=loki1.local \ + -e @join.creds \ + || exit diff --git a/group_vars/vm-hosts.yml b/group_vars/vm-hosts.yml index d33f3d5..f36d9d9 100644 --- a/group_vars/vm-hosts.yml +++ b/group_vars/vm-hosts.yml @@ -245,7 +245,7 @@ vm_autostart: - dc-grumbly - dc-headphone - delay 30s -- loki0 +- loki1 - delay 10s - db0 - k8s-ctrl0 diff --git a/hosts b/hosts index b61c815..9c792ab 100644 --- a/hosts +++ b/hosts @@ -90,6 +90,7 @@ k8s-controller k8s-node [loki] +loki1.pyrocufflink.blue [minio-backups] chromie.pyrocufflink.blue @@ -145,6 +146,7 @@ file0.pyrocufflink.blue git0.pyrocufflink.blue haproxy0.pyrocufflink.blue k8s-ctrl0.pyrocufflink.blue +loki1.pyrocufflink.blue nvr2.pyrocufflink.blue pxe0.pyrocufflink.blue smtp1.pyrocufflink.blue diff --git a/migration/loki0-to-loki1.sh b/migration/loki0-to-loki1.sh new file mode 100644 index 0000000..110f7b4 --- /dev/null +++ b/migration/loki0-to-loki1.sh @@ -0,0 +1,40 @@ +#!/bin/sh +# vim: set sw=4 ts=4 sts=4 et : + +set -e + +cleanup() { + eval $(ssh-agent -k) +} + +trap cleanup INT TERM QUIT EXIT + +eval $(ssh-agent) +sshca-cli user login +ssh-add -K + +: || { +ssh root@loki0.pyrocufflink.blue cat '>' .ssh/known_hosts <