From 820723748bd131e414be8dca1ed0bda60a524f48 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 10 Oct 2024 15:14:25 -0500 Subject: [PATCH] make server libvirt files Signed-off-by: Jeff Carr --- Makefile | 13 +++++++++---- control | 2 +- farm/Makefile | 30 ++++++++++++++++++++++++++++++ farm/farm01_server_template.info | 5 +++++ farm/farm02_server_template.info | 5 +++++ 5 files changed, 50 insertions(+), 5 deletions(-) create mode 100644 farm/Makefile create mode 100644 farm/farm01_server_template.info create mode 100644 farm/farm02_server_template.info diff --git a/Makefile b/Makefile index 89e08f2..5d1522a 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ -STAMP = $(shell date +%Y%m%d-%H%M%S) +STAMP = $(shell date +%Y%m%d.%H%M%S) ls: - ls -l + @echo "make all # will make the cert file and debian package" all: make make-ca-private-key make make-Certificate-Authority-Certificate-file + cd farm && make all make create make-ca-private-key: @@ -23,15 +24,19 @@ create: mkdir -p debian/files/etc/pki/CA/ mkdir -p debian/DEBIAN cp control debian/DEBIAN/ + echo "Version: 0."$(STAMP) >> debian/DEBIAN/control echo "2.0" > debian/debian-binary - cp certificate_authority_certificate.pem debian/files/etc/pki/CA/cacert.pem - chmod 444 debian/files/etc/pki/CA/cacert.pem + cp certificate_authority_key.pem debian/files/etc/pki/CA/cacert.pem + cp farm/*server_key.pem debian/files/etc/pki/CA/ + chmod 444 debian/files/etc/pki/CA/*.pem cd debian/files/ && md5sum etc/pki/CA/cacert.pem > ../DEBIAN/md5sum cd debian/DEBIAN && tar --ignore-failed-read -cvJf ../control.tar.xz {post,pre}{inst,rm} md5sums control cd debian/files && tar -cvJf ../data.tar.xz . cd debian && ar rcs ../wit-libvirt-tls-cert.$(STAMP).deb debian-binary control.tar.xz data.tar.xz + dpkg-deb -I wit*.deb clean: rm -f *.pem rm -f *.deb rm -rf debian/ + cd farm && make clean diff --git a/control b/control index d4aca76..0cf0371 100644 --- a/control +++ b/control @@ -1,6 +1,6 @@ Package: wit-libvirt-tls-cert Source: wit-libvirt-tls-cert -Version: 0.1 +OldVersion: 0.1 Architecture: amd64 Maintainer: Jeff Carr Homepage: https://www.wit.com/ diff --git a/farm/Makefile b/farm/Makefile new file mode 100644 index 0000000..7e864e7 --- /dev/null +++ b/farm/Makefile @@ -0,0 +1,30 @@ +info: + @echo "make all # makes the certs" + +all: + make mkcerts + make certtool-farm01 + make certtool-farm02 + +mkcerts: + certtool --generate-privkey > farm01_server_key.pem + certtool --generate-privkey > farm02_server_key.pem + +certtool-farm01: + certtool --generate-certificate \ + --template farm01_server_template.info \ + --load-privkey farm01_server_key.pem \ + --load-ca-certificate ../certificate_authority_certificate.pem \ + --load-ca-privkey ../certificate_authority_key.pem \ + --outfile farm01_server_certificate.pem + +certtool-farm02: + certtool --generate-certificate \ + --template farm02_server_template.info \ + --load-privkey farm02_server_key.pem \ + --load-ca-certificate ../certificate_authority_certificate.pem \ + --load-ca-privkey ../certificate_authority_key.pem \ + --outfile farm02_server_certificate.pem + +clean: + rm -f *.pem diff --git a/farm/farm01_server_template.info b/farm/farm01_server_template.info new file mode 100644 index 0000000..93fde17 --- /dev/null +++ b/farm/farm01_server_template.info @@ -0,0 +1,5 @@ +organization = WIT.COM Inc. +cn = farm01 +tls_www_server +encryption_key +signing_key diff --git a/farm/farm02_server_template.info b/farm/farm02_server_template.info new file mode 100644 index 0000000..4695e18 --- /dev/null +++ b/farm/farm02_server_template.info @@ -0,0 +1,5 @@ +organization = WIT.COM Inc. +cn = farm02 +tls_www_server +encryption_key +signing_key