TerraSemaphore
This commit is contained in:
parent
028f7f67a2
commit
f74e16719a
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
credentials.auto.tfvars
|
||||
@ -0,0 +1,5 @@
|
||||
proxmox_api_url= "https://192.168.1.155:8006/api2/json"
|
||||
proxmox_api_token_id= "root@pam!TerraDemo"
|
||||
proxmox_api_token_secret= "4f6c33d0-7a29-4238-815c-ad7d368dae66"
|
||||
root_password = "Zakaria1986!!!"
|
||||
ssh_public_key = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO65p1xPly/h1Pso+G44zFnIBX2x7OfrZkXIb22JmW8J k_ansible"
|
||||
27
lxc_Demo.tf
27
lxc_Demo.tf
@ -0,0 +1,27 @@
|
||||
resource "proxmox_lxc" "TerraformDemo" {
|
||||
target_node = "ThePearl"
|
||||
hostname = "lxc-SemaTerra"
|
||||
ostemplate = "local:vztmpl/ubuntu-24.04-standard_24.04-2_amd64.tar.zst"
|
||||
password = var.root_password
|
||||
unprivileged = true
|
||||
memory = 2048
|
||||
swap = 512
|
||||
cores = 2
|
||||
cpulimit = 2
|
||||
|
||||
ssh_keys = [
|
||||
var.ssh_public_key
|
||||
]
|
||||
|
||||
// Terraform will crash without rootfs defined
|
||||
rootfs {
|
||||
storage = "TheTower"
|
||||
size = "4G"
|
||||
}
|
||||
|
||||
network {
|
||||
name = "eth0"
|
||||
bridge = "vmbr0"
|
||||
ip = "dhcp"
|
||||
}
|
||||
}
|
||||
38
providers.tf
38
providers.tf
@ -0,0 +1,38 @@
|
||||
terraform {
|
||||
required_version = ">=0.14"
|
||||
required_providers {
|
||||
proxmox = {
|
||||
source = "Telmate/proxmox"
|
||||
version = "3.0.1-rc1"
|
||||
}
|
||||
}
|
||||
}
|
||||
variable "root_password" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "ssh_public_key" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
variable "proxmox_api_url" {
|
||||
type = string
|
||||
|
||||
}
|
||||
variable "proxmox_api_token_id" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
variable "proxmox_api_token_secret" {
|
||||
type = string
|
||||
sensitive = true
|
||||
}
|
||||
|
||||
provider "proxmox" {
|
||||
pm_tls_insecure = true
|
||||
pm_api_url = var.proxmox_api_url
|
||||
pm_api_token_id = var.proxmox_api_token_id
|
||||
pm_api_token_secret= var.proxmox_api_token_secret
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user