module_alpine_postinstall/main.tf

30 lines
758 B
Terraform
Raw Normal View History

2022-11-28 14:06:16 +00:00
## NEED a provider
# use in root module:
#
# module "postinstall" {
# source "../alpine_postinstall"
# connexion_ip = var.eth0_ip
# connexion_private_key = var.pm_private_key
# }
resource "null_resource" "alpine_postinstall" {
connection {
type = "ssh"
user = "root"
host = var.connection_ip
private_key = var.connection_private_key
}
provisioner "remote-exec" {
inline = [
# see https://git.alpinelinux.org/aports/tree/main/
"echo '#--------------------------'",
"echo '# module alpine_postinstall'",
"echo '#--------------------------'",
"apk add file man-pages tzdata bash htop vim",
"apk add openssh-server",
"echo '# module DONE'",
]
}
}