test
This commit is contained in:
22
testvm.tf
22
testvm.tf
@@ -1,19 +1,3 @@
|
||||
variable "ip" {
|
||||
description = "Ip address of vm"
|
||||
type = string
|
||||
default = "192.168.0.64" # Optional: A default value
|
||||
}
|
||||
|
||||
variable "hostname" {
|
||||
description = "test2"
|
||||
type = string
|
||||
default = "t2.micro" # Optional: A default value
|
||||
}
|
||||
|
||||
variable "flask_token" {
|
||||
type = string
|
||||
}
|
||||
|
||||
resource "proxmox_lxc" "test2" {
|
||||
target_node = "ryuk"
|
||||
hostname = var.hostname
|
||||
@@ -54,7 +38,9 @@ resource "proxmox_lxc" "test2" {
|
||||
gw = "192.168.0.1"
|
||||
}
|
||||
|
||||
provisioner "local-exec" {
|
||||
command = "curl -k -X POST https://192.168.0.143:5000/setupansible/${var.hostname}/${var.ip} -H \"Authorization: Bearer ${var.flask_token}\""
|
||||
module "ansible_setup" {
|
||||
source = "./ansible_setup.tf"
|
||||
hostname = "test2"
|
||||
ip = "192.168.0.64"
|
||||
}
|
||||
}
|
||||
|
||||
12
wikmd.tf
12
wikmd.tf
@@ -1,9 +1,3 @@
|
||||
module "ansible_setup" {
|
||||
source = "./provider.tf"
|
||||
hostname = "wikmd"
|
||||
ip = "192.168.0.56"
|
||||
}
|
||||
|
||||
resource "proxmox_lxc" "wikmd" {
|
||||
target_node = "ryuk"
|
||||
hostname = var.hostname
|
||||
@@ -43,4 +37,10 @@ resource "proxmox_lxc" "wikmd" {
|
||||
ip = "${var.ip}/24"
|
||||
gw = "192.168.0.1"
|
||||
}
|
||||
|
||||
module "ansible_setup" {
|
||||
source = "./ansible_setup.tf"
|
||||
hostname = "wikmd"
|
||||
ip = "192.168.0.56"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user