Make path to generated inventory configurable
This commit is contained in:
parent
b3745f2614
commit
8766b36144
3 changed files with 7 additions and 1 deletions
|
@ -181,7 +181,7 @@ data "template_file" "inventory" {
|
||||||
|
|
||||||
resource "null_resource" "inventories" {
|
resource "null_resource" "inventories" {
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
command = "echo '${data.template_file.inventory.rendered}' > ../../../inventory/hosts"
|
command = "echo '${data.template_file.inventory.rendered}' > ${var.inventory_file}"
|
||||||
}
|
}
|
||||||
|
|
||||||
triggers {
|
triggers {
|
||||||
|
|
|
@ -31,3 +31,5 @@ default_tags = {
|
||||||
# Env = "devtest"
|
# Env = "devtest"
|
||||||
# Product = "kubernetes"
|
# Product = "kubernetes"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inventory_file = "../../../inventory/hosts"
|
||||||
|
|
|
@ -103,3 +103,7 @@ variable "default_tags" {
|
||||||
description = "Default tags for all resources"
|
description = "Default tags for all resources"
|
||||||
type = "map"
|
type = "map"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
variable "inventory_file" {
|
||||||
|
description = "Where to store the generated inventory file"
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue