From 687009b9688e929ea81b82708cd4fc4411801c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulises=20Gasc=C3=B3n?= Date: Tue, 10 Sep 2024 06:20:46 +0200 Subject: [PATCH] feat: add GitHub host key to known hosts --- orka/templates/macos-13-arm-release.pkr.hcl | 8 +++++++- orka/templates/macos-13-arm-test.pkr.hcl | 8 +++++++- orka/templates/macos-13-intel-release.pkr.hcl | 8 +++++++- orka/templates/macos-13-intel-test.pkr.hcl | 10 ++++++++-- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/orka/templates/macos-13-arm-release.pkr.hcl b/orka/templates/macos-13-arm-release.pkr.hcl index f706ee31c..c94d8530d 100644 --- a/orka/templates/macos-13-arm-release.pkr.hcl +++ b/orka/templates/macos-13-arm-release.pkr.hcl @@ -63,7 +63,13 @@ build { "chmod 600 /Users/${var.ssh_default_username}/.ssh/authorized_keys" ] } - + // Add GitHub host key to known hosts. + provisioner "shell" { + inline = [ + "echo 'Adding GitHub host key to known hosts...'", + "ssh-keyscan github.com >> /Users/${var.ssh_default_username}/.ssh/known_hosts" + ] + } // Disable SSH password authentication. // @TODO: Review fallback to password authentication. provisioner "shell" { diff --git a/orka/templates/macos-13-arm-test.pkr.hcl b/orka/templates/macos-13-arm-test.pkr.hcl index f3307b4aa..df4371b80 100644 --- a/orka/templates/macos-13-arm-test.pkr.hcl +++ b/orka/templates/macos-13-arm-test.pkr.hcl @@ -69,7 +69,13 @@ build { "chmod 600 /Users/${var.ssh_default_username}/.ssh/authorized_keys" ] } - + // Add GitHub host key to known hosts. + provisioner "shell" { + inline = [ + "echo 'Adding GitHub host key to known hosts...'", + "ssh-keyscan github.com >> /Users/${var.ssh_default_username}/.ssh/known_hosts" + ] + } // Disable SSH password authentication. // @TODO: Review fallback to password authentication. provisioner "shell" { diff --git a/orka/templates/macos-13-intel-release.pkr.hcl b/orka/templates/macos-13-intel-release.pkr.hcl index b3f84e9b6..ba79bba4c 100644 --- a/orka/templates/macos-13-intel-release.pkr.hcl +++ b/orka/templates/macos-13-intel-release.pkr.hcl @@ -62,7 +62,13 @@ build { "chmod 600 /Users/${var.ssh_default_username}/.ssh/authorized_keys" ] } - + // Add GitHub host key to known hosts. + provisioner "shell" { + inline = [ + "echo 'Adding GitHub host key to known hosts...'", + "ssh-keyscan github.com >> /Users/${var.ssh_default_username}/.ssh/known_hosts" + ] + } // Disable SSH password authentication. // @TODO: Review fallback to password authentication. provisioner "shell" { diff --git a/orka/templates/macos-13-intel-test.pkr.hcl b/orka/templates/macos-13-intel-test.pkr.hcl index 58fba9440..fdc96bc03 100644 --- a/orka/templates/macos-13-intel-test.pkr.hcl +++ b/orka/templates/macos-13-intel-test.pkr.hcl @@ -68,8 +68,14 @@ build { "chmod 700 /Users/${var.ssh_default_username}/.ssh", "chmod 600 /Users/${var.ssh_default_username}/.ssh/authorized_keys" ] - } - + } + // Add GitHub host key to known hosts. + provisioner "shell" { + inline = [ + "echo 'Adding GitHub host key to known hosts...'", + "ssh-keyscan github.com >> /Users/${var.ssh_default_username}/.ssh/known_hosts" + ] + } // Disable SSH password authentication. // @TODO: Review fallback to password authentication. provisioner "shell" {