Skip to content

Commit

Permalink
Merge pull request #466 from citrus-it/pwauth
Browse files Browse the repository at this point in the history
correct cloud-init ssh_pwauth item
  • Loading branch information
hadfl authored Jan 1, 2024
2 parents 1051cb7 + b886af1 commit db50c44
Showing 1 changed file with 8 additions and 3 deletions.
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

0 comments on commit db50c44

Please sign in to comment.