AWS nodes and user-data created from config map.
parent
a730a9d940
commit
df53ae047d
@ -0,0 +1,9 @@
|
||||
data "template_file" "user-datas" {
|
||||
template = file("${var.cloud-init-template}")
|
||||
vars = {
|
||||
admin-passwd = "${var.root-admin-passwd}"
|
||||
admin-pub-key = "${var.root-admin-pub-key}"
|
||||
hostname = "${var.hostname-prefix}-${count.index}"
|
||||
}
|
||||
count = var.num
|
||||
}
|
||||
@ -0,0 +1,3 @@
|
||||
output "user-datas" {
|
||||
value = data.template_file.user-datas
|
||||
}
|
||||
@ -0,0 +1,22 @@
|
||||
variable "cloud-init-template" {
|
||||
default = "../../cloud_init.cfg"
|
||||
description = "The path to the cloud-init config template."
|
||||
type = string
|
||||
}
|
||||
|
||||
variable "hostname-prefix" {
|
||||
description = "This prefix wil be applied as a prefix for the hostnames."
|
||||
}
|
||||
|
||||
variable "num" {
|
||||
description = "The number of user-datas to create with these parameters."
|
||||
}
|
||||
|
||||
variable "root-admin-passwd" {
|
||||
description = "This value will be substituted for any occurence of 'admin-password' in the cloud-init config template."
|
||||
}
|
||||
|
||||
variable "root-admin-pub-key" {
|
||||
description = "This value will be substituted for any occurence of 'admin-pub-key' in the cloud-init config template."
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue