aboutsummaryrefslogtreecommitdiff
path: root/opentofu
diff options
context:
space:
mode:
authorclyhtsuriva <aimeric@adjutor.xyz>2025-02-02 19:51:54 +0100
committerclyhtsuriva <aimeric@adjutor.xyz>2025-02-02 19:51:54 +0100
commite1688aa9f2c3cc09f05c007c921bc24ed566e8e8 (patch)
treee02fcfe7ed41855cf71c90f74aeec5e1630886ba /opentofu
parent93f98bb6051fa702458f6853873a4443a401ba87 (diff)
opentofu : Moving version definition from provider.tf to versions.tf
Diffstat (limited to 'opentofu')
-rw-r--r--opentofu/README.md44
-rw-r--r--opentofu/provider.tf11
-rw-r--r--opentofu/versions.tf14
3 files changed, 46 insertions, 23 deletions
diff --git a/opentofu/README.md b/opentofu/README.md
index 8521989..1bf6e55 100644
--- a/opentofu/README.md
+++ b/opentofu/README.md
@@ -1,14 +1,34 @@
# OpenTofu Infrastructure Provisioning
-This folder contains OpenTofu configurations and modules for provisioning infrastructure in my homelab environment.
-
-## Structure
-
-- **`README.md`**: Project overview.
-- **`examples/`**: Sample configurations demonstrating module usage.
-- **`main.tf`**: Primary entry point for the OpenTofu configuration.
-- **`modules/`**: Reusable OpenTofu modules for provisioning infrastructure.
-- **`outputs.tf`**: Definitions of outputs from the configuration.
-- **`variables.tf`**: Definitions of input variables for the configuration.
-- **`versions.tf`**: Specifies required provider versions.
-- to complete ..
+This repository contains OpenTofu configurations and modules for automating infrastructure provisioning in my homelab environment.
+
+## **Overview**
+OpenTofu is used to define, manage, and provision infrastructure as code (IaC). This setup provides a modular approach for creating and managing infrastructure efficiently.
+
+## **Project Structure**
+- **`README.md`** – Project overview and documentation.
+- **`examples/`** – Sample configurations demonstrating how to use modules in different scenarios.
+- **`main.tf`** – Primary OpenTofu configuration file, orchestrating resource provisioning.
+- **`modules/`** – Reusable OpenTofu modules for provisioning infrastructure components.
+- **`outputs.tf`** – Definitions of outputs to expose key resource attributes.
+- **`provider.tf`** – Configuration for OpenTofu providers, such as Proxmox.
+- **`terraform.tfvars`** – Variable values for customizing deployments.
+- **`variables.tf`** – Definitions of input variables used across the configuration.
+- **`versions.tf`** – Specifies required OpenTofu and provider versions to maintain compatibility.
+
+## **Credentials**
+
+There needs to be a file with credentials in them.
+With this kind of content :
+
+```tf
+proxmox_api_url = "https://<pve ip/fqdn>:<port>/api2/json"
+proxmox_api_token_id = "<id>"
+proxmox_api_token_secret = "<token>"
+```
+
+Refer to this :
+
+- https://opentofu.org/docs/language/values/variables/#variable-definition-precedence
+- https://registry.terraform.io/providers/Telmate/proxmox/latest/docs
+
diff --git a/opentofu/provider.tf b/opentofu/provider.tf
index b78c91a..fade80e 100644
--- a/opentofu/provider.tf
+++ b/opentofu/provider.tf
@@ -1,14 +1,3 @@
-terraform {
- required_version = ">= 0.13.0"
-
- required_providers {
- proxmox = {
- source = "telmate/proxmox"
- version = "3.0.1-rc6"
- }
- }
-}
-
provider "proxmox" {
pm_api_url = var.proxmox_api_url
pm_api_token_id = var.proxmox_api_token_id
diff --git a/opentofu/versions.tf b/opentofu/versions.tf
new file mode 100644
index 0000000..04a162a
--- /dev/null
+++ b/opentofu/versions.tf
@@ -0,0 +1,14 @@
+terraform {
+ required_version = ">= 1.8.0"
+
+ required_providers {
+ proxmox = {
+ source = "telmate/proxmox"
+ version = "3.0.1-rc6"
+ }
+ null = {
+ source = "hashicorp/null"
+ version = ">= 0.0.0"
+ }
+ }
+}