Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dns bootstrap during iso install #269

Merged
merged 1 commit into from
Mar 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()]


Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you removed setup_dns_bootstrap from the cluster init sequence? You probably should.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

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

Expand Down