anisble-setup api config
This commit is contained in:
18
ansible_setup.tf
Normal file
18
ansible_setup.tf
Normal file
@@ -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}\""
|
||||||
|
}
|
||||||
|
}
|
||||||
20
provider.tf
20
provider.tf
@@ -39,23 +39,3 @@ terraform {
|
|||||||
#credentials are stored in semaphore secrets
|
#credentials are stored in semaphore secrets
|
||||||
backend "pg" {}
|
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}\""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user