module alpine postinstall
This commit is contained in:
commit
99550a76d0
|
@ -0,0 +1,29 @@
|
|||
## 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'",
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
variable "connection_ip" {
|
||||
type = string
|
||||
description = "ipv4"
|
||||
}
|
||||
|
||||
variable "connection_private_key" {
|
||||
type = string
|
||||
description = "private key used by terraform"
|
||||
sensitive = true
|
||||
}
|
||||
|
Loading…
Reference in New Issue