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

correct cloud-init ssh_pwauth item #466

Merged
merged 3 commits into from
Jan 1, 2024
Merged
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
11 changes: 8 additions & 3 deletions src/brand/bhyve/bootlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ def build_cloudinit_image(self, uuid, src, testmode):
if (v := self.findattr("password")) is not None:
user_data["password"] = file_or_string(v.get("value"))
user_data["chpasswd"] = {"expire": False}
user_data["ssh-pwauth"] = True
user_data["ssh_pwauth"] = True

if (v := self.findattr("sshkey")) is not None:
v = file_or_string(v.get("value"))
Expand All @@ -208,7 +208,7 @@ def build_cloudinit_image(self, uuid, src, testmode):
network_data = {}

addresses = self.findall("./network[@allowed-address]")
if addresses is not None:
if len(addressess) > 0:
nsdone = False
network_data["version"] = 2
network_data["ethernets"] = {}
Expand All @@ -228,7 +228,12 @@ def build_cloudinit_image(self, uuid, src, testmode):
"addresses": [addr],
}
if rtr:
data["gateway4"] = rtr
data["routes"] = [
{
"to": "0.0.0.0/0",
"via": rtr,
}
]

if not nsdone:
domain = self.findattr("dns-domain")
Expand Down