alpine example: restart ssh server instead of rebooting

This commit is contained in:
Adrien Delorme 2020-07-13 12:49:07 +02:00
parent 77411107c2
commit cd0f72a7b6
3 changed files with 4 additions and 2 deletions

View File

@ -21,7 +21,6 @@ EOF
boot_wait = "10s" boot_wait = "10s"
} }
provisioner "shell" { provisioner "shell" {
inline = ["echo hi"] inline = ["echo hi"]
} }

View File

@ -13,7 +13,11 @@ poweroff
EOF EOF
chmod +x /usr/local/bin/shutdown chmod +x /usr/local/bin/shutdown
ifconfig eth0 up && udhcpc -i eth0
sed -i "/#PermitRootLogin/c\PermitRootLogin yes" /etc/ssh/sshd_config sed -i "/#PermitRootLogin/c\PermitRootLogin yes" /etc/ssh/sshd_config
sed -i "/#PasswordAuthentication/c\PasswordAuthentication yes" /etc/ssh/sshd_config sed -i "/#PasswordAuthentication/c\PasswordAuthentication yes" /etc/ssh/sshd_config
mkdir ~/.ssh mkdir ~/.ssh
# copy ssy key ? # copy ssy key ?
/etc/init.d/sshd restart

View File

@ -27,7 +27,6 @@ locals {
"${var.alpine_password}<enter><wait>", "${var.alpine_password}<enter><wait>",
"mount -t vfat /dev/fd0 /media/floppy<enter><wait>", "mount -t vfat /dev/fd0 /media/floppy<enter><wait>",
"/media/floppy/alpine-setup.sh<enter>", "/media/floppy/alpine-setup.sh<enter>",
"reboot<enter>",
] ]
} }