61 lines
992 B
HCL
61 lines
992 B
HCL
# Proxmox Provider
|
|
# ---
|
|
# Initial Provider Configuration for Proxmox
|
|
|
|
terraform {
|
|
|
|
required_providers {
|
|
proxmox = {
|
|
source = "Telmate/proxmox"
|
|
version = "3.0.2-rc03"
|
|
}
|
|
}
|
|
}
|
|
|
|
variable "proxmox_api_url" {
|
|
type = string
|
|
}
|
|
|
|
variable "pm_user" {
|
|
type = string
|
|
}
|
|
|
|
variable "pm_pass" {
|
|
type = string
|
|
}
|
|
|
|
provider "proxmox" {
|
|
|
|
pm_api_url = var.proxmox_api_url
|
|
pm_user = var.pm_user
|
|
pm_password = var.pm_pass
|
|
|
|
# (Optional) Skip TLS Verification
|
|
pm_tls_insecure = true
|
|
|
|
}
|
|
|
|
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}\""
|
|
}
|
|
} |