From 04bf6acbc4b2f6e8f4e800500de9e0a3606017e9 Mon Sep 17 00:00:00 2001 From: tolerryan <105945216+tolerryan@users.noreply.github.com> Date: Tue, 4 Nov 2025 01:04:26 -0600 Subject: [PATCH] anisble-setup api config --- ansible_setup.tf | 18 ++++++++++++++++++ provider.tf | 20 -------------------- 2 files changed, 18 insertions(+), 20 deletions(-) create mode 100644 ansible_setup.tf diff --git a/ansible_setup.tf b/ansible_setup.tf new file mode 100644 index 0000000..01bcbe1 --- /dev/null +++ b/ansible_setup.tf @@ -0,0 +1,18 @@ +variable "hostname" { + type = string +} + +variable "ip" { + type = string +} + +variable "flask_token" { + type = string + sensitive = true +} + +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/provider.tf b/provider.tf index d4798da..c2c7aeb 100644 --- a/provider.tf +++ b/provider.tf @@ -39,23 +39,3 @@ terraform { #credentials are stored in semaphore secrets backend "pg" {} } - - -variable "hostname" { - type = string -} - -variable "ip" { - type = string -} - -variable "flask_token" { - type = string - sensitive = true -} - -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