Skip to content

Commit

Permalink
Setup DNS bootstrapping during ISO install.
Browse files Browse the repository at this point in the history
  • Loading branch information
minced committed Mar 12, 2018
1 parent cb611c5 commit 73dadc4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
6 changes: 6 additions & 0 deletions building/build-debs/homeworld-admin-tools/debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
homeworld-admin-tools (0.1.50) stretch; urgency=medium

* Updated debian release

-- Matthew Ince <[email protected]> Mon, 29 Jan 2018 17:25:01 -0500

homeworld-admin-tools (0.1.49) stretch; urgency=medium

* Updated debian release
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ cp /keyservertls.pem /target/etc/homeworld/keyclient/keyservertls.pem
cp /keyclient-*.yaml /target/etc/homeworld/config/
cp /keyclient-base.yaml /target/etc/homeworld/config/keyclient.yaml
cp /sshd_config.new /target/etc/ssh/sshd_config
cat /dns_bootstrap_lines >> /target/etc/hosts

cat >/tmp/token.template <<EOF
Template: homeworld/asktoken
Expand Down
5 changes: 5 additions & 0 deletions building/build-debs/homeworld-admin-tools/src/iso.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import util
import packages
import keycrypt
import setup
from version import get_git_version

PACKAGES = ("homeworld-apt-setup",)
Expand Down Expand Up @@ -54,6 +55,10 @@ def gen_iso(iso_image, authorized_key, cdpack=None):
with tempfile.TemporaryDirectory() as d:
inclusion = []

with open(os.path.join(d, "dns_bootstrap_lines"), "w") as outfile:
outfile.writelines(setup.dns_bootstrap_lines());

inclusion += ["dns_bootstrap_lines"]
util.copy(authorized_key, os.path.join(d, "authorized.pub"))
util.writefile(os.path.join(d, "keyservertls.pem"), authority.get_pubkey_by_filename("./server.pem"))
resource.copy_to("postinstall.sh", os.path.join(d, "postinstall.sh"))
Expand Down
2 changes: 0 additions & 2 deletions building/build-debs/homeworld-admin-tools/src/seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@ def sequence_cluster(ops: setup.Operations) -> None:
ops.add_operation("verify that the fundamental cluster infrastructure is online",
iterative_verifier(verify.check_online, 120.0))

ops.add_subcommand(setup.setup_dns_bootstrap)

ops.add_operation("verify that etcd has launched successfully",
iterative_verifier(verify.check_etcd_health, 120.0))
ops.add_operation("verify that kubernetes has launched successfully",
Expand Down
5 changes: 5 additions & 0 deletions building/build-debs/homeworld-admin-tools/src/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,11 @@ def modify_dns_bootstrap(ops: Operations, is_install: bool) -> None:
ops.ssh_raw("bootstrap dns on @HOST: %s" % hostname, node, strip_cmd)


def dns_bootstrap_lines() -> list:
config = configuration.get_config()
return ["%s\t%s # AUTO-HOMEWORLD-BOOTSTRAP" % (ip, hostname) for hostname, ip in config.dns_bootstrap.items()]


def setup_dns_bootstrap(ops: Operations) -> None:
modify_dns_bootstrap(ops, True)

Expand Down

0 comments on commit 73dadc4

Please sign in to comment.