alpine example: restart ssh server instead of rebooting
This commit is contained in:
parent
77411107c2
commit
cd0f72a7b6
|
@ -21,7 +21,6 @@ EOF
|
||||||
boot_wait = "10s"
|
boot_wait = "10s"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
provisioner "shell" {
|
provisioner "shell" {
|
||||||
inline = ["echo hi"]
|
inline = ["echo hi"]
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
|
@ -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>",
|
|
||||||
]
|
]
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue