feat: fully vibecoded configuration
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
resource "ovh_cloud_project_keypair" "deploy_key" {
|
||||
service_name = var.ovh_service_name
|
||||
name = "coolify_deploy_key"
|
||||
public_key = var.ssh_public_key
|
||||
region = var.region
|
||||
}
|
||||
|
||||
resource "ovh_cloud_project_instance" "coolify" {
|
||||
service_name = var.ovh_service_name
|
||||
name = var.instance_name
|
||||
region = var.region
|
||||
flavor_name = var.flavor_name
|
||||
image_name = var.image_name
|
||||
key_pair = ovh_cloud_project_keypair.deploy_key.name
|
||||
}
|
||||
|
||||
# Generate inventory file for Ansible
|
||||
resource "local_file" "ansible_inventory" {
|
||||
content = templatefile("${path.module}/../ansible/inventory.tpl", {
|
||||
vps_ip = ovh_cloud_project_instance.coolify.ipv4_addresses[0]
|
||||
})
|
||||
filename = "${path.module}/../ansible/inventory.ini"
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
output "vps_ip" {
|
||||
description = "The public IPv4 address of the Coolify VPS"
|
||||
value = ovh_cloud_project_instance.coolify.ipv4_addresses[0]
|
||||
}
|
||||
|
||||
output "instance_id" {
|
||||
description = "The ID of the provisioned OVH instance"
|
||||
value = ovh_cloud_project_instance.coolify.id
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
terraform {
|
||||
required_version = ">= 1.3.0"
|
||||
required_providers {
|
||||
ovh = {
|
||||
source = "ovh/ovh"
|
||||
version = "~> 0.43.0"
|
||||
}
|
||||
}
|
||||
backend "http" {} # Allows local and Gitea Actions to share state securely
|
||||
}
|
||||
|
||||
provider "ovh" {
|
||||
endpoint = var.ovh_endpoint
|
||||
application_key = var.ovh_application_key
|
||||
application_secret = var.ovh_application_secret
|
||||
consumer_key = var.ovh_consumer_key
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
variable "ovh_endpoint" {
|
||||
type = string
|
||||
description = "OVH API endpoint (e.g., ovh-eu, ovh-us, ovh-ca)"
|
||||
default = "ovh-eu"
|
||||
}
|
||||
|
||||
variable "ovh_application_key" {
|
||||
type = string
|
||||
description = "OVH Application Key"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "ovh_application_secret" {
|
||||
type = string
|
||||
description = "OVH Application Secret"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "ovh_consumer_key" {
|
||||
type = string
|
||||
description = "OVH Consumer Key"
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "ovh_service_name" {
|
||||
type = string
|
||||
description = "OVH Public Cloud Project ID (Service Name)"
|
||||
}
|
||||
|
||||
variable "region" {
|
||||
type = string
|
||||
description = "OVH Region to deploy the VPS in (e.g., GRA11, SBG5, WAW1)"
|
||||
default = "GRA11"
|
||||
}
|
||||
|
||||
variable "instance_name" {
|
||||
type = string
|
||||
description = "Name of the VPS/Instance"
|
||||
default = "coolify-vps"
|
||||
}
|
||||
|
||||
variable "flavor_name" {
|
||||
type = string
|
||||
description = "The hardware flavor / size of the VPS (Coolify recommends at least 2 vCPUs and 4GB RAM)"
|
||||
default = "b2-7" # 2 vCPUs, 7GB RAM (excellent for Coolify)
|
||||
}
|
||||
|
||||
variable "image_name" {
|
||||
type = string
|
||||
description = "The OS Image name"
|
||||
default = "Ubuntu 22.04"
|
||||
}
|
||||
|
||||
variable "ssh_public_key" {
|
||||
type = string
|
||||
description = "SSH public key content to be authorized on the VPS"
|
||||
}
|
||||
Reference in New Issue
Block a user