From cd0f72a7b66d53c52e97b525a2b9c583f3a39f62 Mon Sep 17 00:00:00 2001 From: Adrien Delorme Date: Mon, 13 Jul 2020 12:49:07 +0200 Subject: [PATCH] alpine example: restart ssh server instead of rebooting --- examples/hcl/linux/build.alpine.pkr.hcl | 1 - examples/hcl/linux/etc/http/alpine-setup.sh | 4 ++++ examples/hcl/linux/variables.alpine.pkr.hcl | 1 - 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/hcl/linux/build.alpine.pkr.hcl b/examples/hcl/linux/build.alpine.pkr.hcl index 4b90ce38f..dc7a8c80c 100644 --- a/examples/hcl/linux/build.alpine.pkr.hcl +++ b/examples/hcl/linux/build.alpine.pkr.hcl @@ -21,7 +21,6 @@ EOF boot_wait = "10s" } - provisioner "shell" { inline = ["echo hi"] } diff --git a/examples/hcl/linux/etc/http/alpine-setup.sh b/examples/hcl/linux/etc/http/alpine-setup.sh index 8c73c0f80..9b286f332 100644 --- a/examples/hcl/linux/etc/http/alpine-setup.sh +++ b/examples/hcl/linux/etc/http/alpine-setup.sh @@ -13,7 +13,11 @@ poweroff EOF chmod +x /usr/local/bin/shutdown +ifconfig eth0 up && udhcpc -i eth0 + sed -i "/#PermitRootLogin/c\PermitRootLogin yes" /etc/ssh/sshd_config sed -i "/#PasswordAuthentication/c\PasswordAuthentication yes" /etc/ssh/sshd_config mkdir ~/.ssh # copy ssy key ? + +/etc/init.d/sshd restart \ No newline at end of file diff --git a/examples/hcl/linux/variables.alpine.pkr.hcl b/examples/hcl/linux/variables.alpine.pkr.hcl index 699563541..176321a23 100644 --- a/examples/hcl/linux/variables.alpine.pkr.hcl +++ b/examples/hcl/linux/variables.alpine.pkr.hcl @@ -27,7 +27,6 @@ locals { "${var.alpine_password}", "mount -t vfat /dev/fd0 /media/floppy", "/media/floppy/alpine-setup.sh", - "reboot", ] }