diff --git a/modules/ansible_setup.tf b/modules/ansible_setup.tf deleted file mode 100644 index 20a2db1..0000000 --- a/modules/ansible_setup.tf +++ /dev/null @@ -1,13 +0,0 @@ -variable "hostname" { - type = string -} - -variable "ip" { - type = string -} - -resource "null_resource" "ansible_setup" { - 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}\"" - } -} \ No newline at end of file diff --git a/testvm.tf b/testvm.tf index 73f0942..dcc17ce 100644 --- a/testvm.tf +++ b/testvm.tf @@ -37,10 +37,8 @@ resource "proxmox_lxc" "test2" { ip = "192.168.0.64/24" gw = "192.168.0.1" } -} - -module "ansible_setup_test2" { - source = "./modules/ansible_setup" - hostname = "test2" - ip = "192.168.0.64" + + provisioner "local-exec" { + command = "curl -k -X POST https://192.168.0.143:5000/setupansible/test2/192.168.0.64 -H "Authorization: Bearer ${flask_token}" + } } diff --git a/wikmd.tf b/wikmd.tf index 6443cc4..e7e486c 100644 --- a/wikmd.tf +++ b/wikmd.tf @@ -37,10 +37,8 @@ resource "proxmox_lxc" "wikmd" { ip = "192.168.0.56/24" gw = "192.168.0.1" } -} -module "ansible_setup_wikmd" { - source = "./modules/ansible_setup" - hostname = "wikmd" - ip = "192.168.0.56" + provisioner "local-exec" { + command = "curl -k -X POST https://192.168.0.143:5000/setupansible/wikmd/192.168.0.56 -H "Authorization: Bearer ${flask_token}" + } }