Test change setup to api
This commit is contained in:
25
wikmd.tf
25
wikmd.tf
@@ -1,3 +1,19 @@
|
|||||||
|
variable "ip" {
|
||||||
|
description = "Ip address of vm"
|
||||||
|
type = string
|
||||||
|
default = "192.168.0.56" # Optional: A default value
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "hostname" {
|
||||||
|
description = "wikmd"
|
||||||
|
type = string
|
||||||
|
default = "t2.micro" # Optional: A default value
|
||||||
|
}
|
||||||
|
|
||||||
|
variable "flask_token" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
resource "proxmox_lxc" "wikmd" {
|
resource "proxmox_lxc" "wikmd" {
|
||||||
target_node = "ryuk"
|
target_node = "ryuk"
|
||||||
hostname = "wikmd"
|
hostname = "wikmd"
|
||||||
@@ -34,16 +50,13 @@ resource "proxmox_lxc" "wikmd" {
|
|||||||
network {
|
network {
|
||||||
name = "eth0"
|
name = "eth0"
|
||||||
bridge = "vmbr0"
|
bridge = "vmbr0"
|
||||||
ip = "192.168.0.56/24"
|
ip = "${var.ip}/24"
|
||||||
gw = "192.168.0.1"
|
gw = "192.168.0.1"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
provisioner "local-exec" {
|
provisioner "local-exec" {
|
||||||
command = "./.ansible.d/setup.sh $IP"
|
command = "curl -k -X POST https://localhost:5000/setupansible/${var.host}/${var.ip} -H "Authorization: Bearer ${flask_token}"
|
||||||
environment = {
|
|
||||||
IP = "192.168.0.56"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user