aboutsummaryrefslogtreecommitdiff
path: root/opentofu/modules/ansible_provisioner
diff options
context:
space:
mode:
Diffstat (limited to 'opentofu/modules/ansible_provisioner')
-rw-r--r--opentofu/modules/ansible_provisioner/main.tf12
-rw-r--r--opentofu/modules/ansible_provisioner/variables.tf26
2 files changed, 26 insertions, 12 deletions
diff --git a/opentofu/modules/ansible_provisioner/main.tf b/opentofu/modules/ansible_provisioner/main.tf
index cac666d..0de288e 100644
--- a/opentofu/modules/ansible_provisioner/main.tf
+++ b/opentofu/modules/ansible_provisioner/main.tf
@@ -1,15 +1,3 @@
-variable "vm_ip" {
- default = null
-}
-
-variable "inventory_file_path" {
- default = null
-}
-
-variable "vm_username" {}
-variable "ssh_private_key_path" {}
-variable "ansible_playbook_path" {}
-
resource "null_resource" "ansible_provisioner" {
triggers = {
ip_or_inventory = coalesce(var.vm_ip, var.inventory_file_path) # Choose based on what is provided
diff --git a/opentofu/modules/ansible_provisioner/variables.tf b/opentofu/modules/ansible_provisioner/variables.tf
new file mode 100644
index 0000000..0d15d01
--- /dev/null
+++ b/opentofu/modules/ansible_provisioner/variables.tf
@@ -0,0 +1,26 @@
+variable "vm_ip" {
+ type = string
+ default = null
+ description = "The IP address of the VM to provision. Either this or `inventory_file_path` must be provided."
+}
+
+variable "inventory_file_path" {
+ type = string
+ default = null
+ description = "The path to the Ansible inventory file. Either this or `vm_ip` must be provided."
+}
+
+variable "vm_username" {
+ type = string
+ description = "The username to use for SSH access to the VM."
+}
+
+variable "ssh_private_key_path" {
+ type = string
+ description = "The path to the private SSH key for accessing the VM."
+}
+
+variable "ansible_playbook_path" {
+ type = string
+ description = "The path to the Ansible playbook to execute."
+}