From e6f3152a182f19f216250cec6621e53d6896038f Mon Sep 17 00:00:00 2001 From: "Cel A. Skeggs" Date: Tue, 9 Jan 2018 22:33:53 -0500 Subject: [PATCH] Fix #187: preinstall homeworld packages on nodes --- building/build-debs/homeworld-admin-tools/debian/changelog | 6 ++++++ .../homeworld-admin-tools/resources/postinstall.sh | 5 ++++- building/build-debs/homeworld-admin-tools/src/infra.py | 6 ------ building/build-debs/homeworld-admin-tools/src/iso.py | 5 +++-- building/build-debs/homeworld-admin-tools/src/setup.py | 1 + 5 files changed, 14 insertions(+), 9 deletions(-) diff --git a/building/build-debs/homeworld-admin-tools/debian/changelog b/building/build-debs/homeworld-admin-tools/debian/changelog index 92c83541a..84a2905f9 100644 --- a/building/build-debs/homeworld-admin-tools/debian/changelog +++ b/building/build-debs/homeworld-admin-tools/debian/changelog @@ -1,3 +1,9 @@ +homeworld-admin-tools (0.1.29) stretch; urgency=medium + + * Updated debian release + + -- Cel Skeggs Tue, 09 Jan 2018 20:27:58 -0500 + homeworld-admin-tools (0.1.28) stretch; urgency=medium * Updated debian release diff --git a/building/build-debs/homeworld-admin-tools/resources/postinstall.sh b/building/build-debs/homeworld-admin-tools/resources/postinstall.sh index 74528c436..d8e611bea 100644 --- a/building/build-debs/homeworld-admin-tools/resources/postinstall.sh +++ b/building/build-debs/homeworld-admin-tools/resources/postinstall.sh @@ -13,10 +13,13 @@ then exit 1 fi +in-target systemctl mask nginx.service + # install packages cp /homeworld-*.deb /target/ -in-target dpkg -i /homeworld-*.deb +in-target dpkg --unpack /homeworld-*.deb rm /target/homeworld-*.deb +in-target apt-get install --fix-broken --yes in-target systemctl enable keyclient.service update-keyclient-config.timer prometheus-node-exporter.service diff --git a/building/build-debs/homeworld-admin-tools/src/infra.py b/building/build-debs/homeworld-admin-tools/src/infra.py index 8aba091e0..7ccdbb312 100644 --- a/building/build-debs/homeworld-admin-tools/src/infra.py +++ b/building/build-debs/homeworld-admin-tools/src/infra.py @@ -29,12 +29,6 @@ def infra_install_packages(ops: setup.Operations) -> None: for node in config.nodes: ops.ssh("update apt repositories on @HOST", node, "apt-get", "update") ops.ssh("upgrade packages on @HOST", node, "apt-get", "upgrade", "-y") - if node.kind == "supervisor": - ops.ssh("install supervisor packages on @HOST", node, "apt-get", "install", "-y", - "homeworld-bootstrap-registry", "homeworld-prometheus") - else: - ops.ssh("install standard packages on @HOST", node, "apt-get", "install", "-y", - "homeworld-services") main_command = command.mux_map("commands about maintaining the infrastructure of a cluster", { diff --git a/building/build-debs/homeworld-admin-tools/src/iso.py b/building/build-debs/homeworld-admin-tools/src/iso.py index f9c4a6a60..2f34dfc04 100644 --- a/building/build-debs/homeworld-admin-tools/src/iso.py +++ b/building/build-debs/homeworld-admin-tools/src/iso.py @@ -11,11 +11,12 @@ import packages import keycrypt -PACKAGES = ("homeworld-apt-setup", "homeworld-knc", "homeworld-keysystem", "homeworld-prometheus-node-exporter") +PACKAGES = ("homeworld-apt-setup", "homeworld-knc", "homeworld-keysystem", "homeworld-prometheus-node-exporter", \ + "homeworld-hyperkube", "homeworld-rkt", "homeworld-etcd", "homeworld-services", "homeworld-bootstrap-registry", \ + "homeworld-prometheus", "homeworld-etcd-metrics-exporter") # TODO: refactor this file to be more maintainable - # converts debian-9.2.0-amd64-mini.iso into a "cdpack", which can be more easily remastered def regen_cdpack(source_iso, dest_cdpack): with tempfile.TemporaryDirectory() as d: diff --git a/building/build-debs/homeworld-admin-tools/src/setup.py b/building/build-debs/homeworld-admin-tools/src/setup.py index 898203497..aa1145ac5 100644 --- a/building/build-debs/homeworld-admin-tools/src/setup.py +++ b/building/build-debs/homeworld-admin-tools/src/setup.py @@ -230,6 +230,7 @@ def setup_bootstrap_registry(ops: Operations) -> None: ops.ssh_mkdir("create ssl cert directory on @HOST", node, "/etc/homeworld/ssl") ops.ssh_upload_bytes("upload %s key to @HOST" % REGISTRY_HOSTNAME, node, keydata, "/etc/homeworld/ssl/%s.key" % REGISTRY_HOSTNAME) ops.ssh_upload_path("upload %s cert to @HOST" % REGISTRY_HOSTNAME, node, certpath, "/etc/homeworld/ssl/%s.pem" % REGISTRY_HOSTNAME) + ops.ssh("unmask nginx on @HOST", node, "systemctl", "unmask", "nginx") ops.ssh("restart nginx on @HOST", node, "systemctl", "restart", "nginx")