Skip to content

Commit

Permalink
Handle multiple public keys correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
amezin committed Dec 26, 2024
1 parent 0be719d commit 57203bc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fedora.ks
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bootloader --location=mbr
firstboot --disable
autopart
user --name=vagrant --groups=wheel --password=vagrant --plaintext
sshkey --username=vagrant "${trimspace(file("${path.root}/keys/vagrant.pub"))}"
${join("\n", formatlist("sshkey --username=vagrant \"%s\"", compact(split("\n", file("${path.root}/keys/vagrant.pub")))))}
reboot

repo --name=fedora --mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
Expand Down
2 changes: 1 addition & 1 deletion silverblue.ks
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ bootloader --location=mbr
firstboot --disable
autopart
user --name=vagrant --groups=wheel --password=vagrant --plaintext
sshkey --username=vagrant "${trimspace(file("${path.root}/keys/vagrant.pub"))}"
${join("\n", formatlist("sshkey --username=vagrant \"%s\"", compact(split("\n", file("${path.root}/keys/vagrant.pub")))))}
ostreesetup --osname="fedora-silverblue" --remote="fedora" --url="file:///ostree/repo" --ref="fedora/${version}/x86_64/silverblue" --nogpg
reboot

Expand Down
3 changes: 1 addition & 2 deletions ubuntu-22.04-autoinstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ autoinstall:
hostname: ${hostname}
ssh:
install-server: yes
authorized-keys:
- ${trimspace(file("${path.root}/keys/vagrant.pub"))}
authorized-keys: ${format("%#v", compact(split("\n", file("${path.root}/keys/vagrant.pub"))))}
allow-pw: yes
packages:
- ubuntu-desktop
Expand Down
3 changes: 1 addition & 2 deletions ubuntu-autoinstall.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ autoinstall:
hostname: ${hostname}
ssh:
install-server: yes
authorized-keys:
- ${trimspace(file("${path.root}/keys/vagrant.pub"))}
authorized-keys: ${format("%#v", compact(split("\n", file("${path.root}/keys/vagrant.pub"))))}
allow-pw: yes
packages:
- qemu-guest-agent
Expand Down

0 comments on commit 57203bc

Please sign in to comment.