19 Commits

Author SHA1 Message Date
adbf69fefe Merge pull request '[deploy-opentofu]' (#295) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#295
2025-10-12 17:14:03 +00:00
5772fb36d2 [deploy-opentofu]
[deploy-opentofu]
2025-10-12 17:08:43 +00:00
99afd901dc Merge pull request '[deploy-opentofu]' (#293) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#293
2025-10-12 16:55:07 +00:00
8a5c2ce64c Merge pull request 'Update documentation/Dockerfile' (#292) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#292
2025-10-12 10:52:33 +00:00
453ff5202e Merge pull request '[deploy-opentofu]' (#291) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#291
2025-10-12 09:38:23 +00:00
d24306ce8c Merge pull request '[deploy-opentofu]' (#290) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#290
2025-10-12 09:13:12 +00:00
b2533ac7cb Merge pull request '[deploy-opentofu]' (#289) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#289
2025-10-12 09:08:43 +00:00
00239da11c Merge pull request '[deploy-opentofu]' (#288) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#288
2025-10-12 09:04:09 +00:00
9911825872 Merge pull request '[deploy-opentofu]' (#287) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#287
2025-10-12 09:00:39 +00:00
1e0110fe1a Merge pull request '[deploy-opentofu]' (#286) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#286
2025-10-11 22:50:43 +00:00
5a24f06fd8 Merge pull request '[deploy-opentofu]' (#285) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#285
2025-10-11 22:37:41 +00:00
11e8997be8 Merge pull request '[deploy-opentofu]' (#284) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#284
2025-10-11 22:34:18 +00:00
d4811cbcfe Merge pull request '[deploy-opentofu]' (#283) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#283
2025-10-11 22:22:27 +00:00
6258d9e279 Merge pull request '[deploy-opentofu]' (#282) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#282
2025-10-11 22:13:01 +00:00
eaadf11a99 Merge pull request '[deploy-opentofu]' (#281) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#281
2025-10-11 22:09:51 +00:00
50e52fb839 Merge pull request '[deploy-opentofu]' (#280) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#280
2025-10-11 21:52:25 +00:00
43bd8914aa Merge pull request '[deploy-opentofu]' (#279) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#279
2025-10-11 21:44:21 +00:00
c457178d48 Merge pull request '[deploy-opentofu]' (#278) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#278
2025-10-11 21:33:00 +00:00
01d40d4120 Merge pull request '[deploy-opentofu]' (#277) from fenix-admin into dev
Reviewed-on: fenix-gitea-admin/iac-opentofu-private#277
2025-10-11 21:26:08 +00:00
10 changed files with 25 additions and 53 deletions

View File

@ -1,3 +1 @@
the most stable branch is main, dev is where tests are made, and the remaining branches are personal and can undergo changes at any time the most stable branch is main, dev is where tests are made, and the remaining branches are personal and can undergo changes at any time
i had to redo consul

View File

@ -19,7 +19,7 @@ resource "proxmox_virtual_environment_download_file" "latest_ubunto_cloud_img" {
content_type = "iso" content_type = "iso"
datastore_id = "local" datastore_id = "local"
node_name = "fenix" node_name = "fenix"
url = "https://cloud-images.ubuntu.com/jammy/20260218/jammy-server-cloudimg-amd64.img" url = "https://cloud-images.ubuntu.com/jammy/20250725/jammy-server-cloudimg-amd64.img"
file_name = "jammyservercloudimgamd64.img" file_name = "jammyservercloudimgamd64.img"
} }
@ -105,7 +105,6 @@ resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
cpu { cpu {
cores = 2 cores = 2
type = "host"
} }
memory { memory {
@ -117,12 +116,11 @@ resource "proxmox_virtual_environment_vm" "proxmox-kubernetes-VM-template" {
file_id = proxmox_virtual_environment_download_file.latest_ubunto_cloud_img.id file_id = proxmox_virtual_environment_download_file.latest_ubunto_cloud_img.id
interface = "scsi0" interface = "scsi0"
file_format = "qcow2" file_format = "qcow2"
size = 64
} }
# Configuração da interface de rede # Configuração da interface de rede
network_device { network_device {
bridge = "vmbr0" # rede de gestão para comunicação com Cluster B bridge = "vmbr0"
} }
initialization { initialization {
@ -134,7 +132,6 @@ initialization {
address = "dhcp" address = "dhcp"
} }
} }
user_data_file_id = proxmox_virtual_environment_file.cloud_init_yaml.id user_data_file_id = proxmox_virtual_environment_file.cloud_init_yaml.id
} }
} }
@ -149,12 +146,10 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
clone { clone {
vm_id = proxmox_virtual_environment_vm.proxmox-kubernetes-VM-template.id vm_id = proxmox_virtual_environment_vm.proxmox-kubernetes-VM-template.id
full = true
} }
cpu { cpu {
cores = each.value.cores cores = each.value.cores
type = "host"
} }
memory { memory {
@ -167,16 +162,6 @@ resource "proxmox_virtual_environment_vm" "k8s_vms" {
interface = "scsi1" interface = "scsi1"
} }
# Bloco dinâmico para lista de hostpci
dynamic "hostpci" {
for_each = try(each.value.hostpci, [])
content {
device = hostpci.value.device
pcie = try(hostpci.value.pcie, true)
mapping = hostpci.value.mapping
}
}
initialization { initialization {
ip_config { ip_config {
ipv4 { ipv4 {

View File

@ -40,13 +40,6 @@ variable "proxmox_k8s_vms" {
vm_id = number vm_id = number
node_name = string node_name = string
ip = string ip = string
ip2 = string
ip3 = string
hostpci = optional(list(object({
pcie = bool
device = string
mapping = string
})))
cores = optional(number) cores = optional(number)
memory = optional(number) memory = optional(number)
data_store = optional(string) data_store = optional(string)

View File

@ -1,13 +0,0 @@
[master]
master1 ansible_host=192.168.1.99 ansible_user=user ansible_ssh_pass=pass ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[workers]
worker-192-168-1-101 ansible_host=192.168.1.101 ansible_user=user ansible_ssh_pass=pass ansible_ssh_common_args='-o StrictHostKeyChecking=no'

View File

@ -1 +0,0 @@
proxmox-ssh.example.com

View File

@ -1 +0,0 @@
https://vaultwarden.example.com

View File

@ -1,6 +1,6 @@
#proxmox_server = "proxmox.example.com" proxmox_server = "proxmox.example.com"
#PM_API_TOKEN_ID = "tokenid" PM_API_TOKEN_ID = "tokenid"
#PM_API_TOKEN_SECRET = "tokensecret" PM_API_TOKEN_SECRET = "tokensecret"
# tokenid is read automatically from PM_API_TOKEN_ID # tokenid is read automatically from PM_API_TOKEN_ID
# token is read automatically from PM_API_TOKEN_SECRET # token is read automatically from PM_API_TOKEN_SECRET
@ -20,7 +20,6 @@ proxmox_k8s_vms = [
vm_id = 3001 vm_id = 3001
node_name = "node" node_name = "node"
ip = "192.168.1.99/24" ip = "192.168.1.99/24"
ip3 = "192.168.1.199/24"
cores = 2 cores = 2
memory = 2000 memory = 2000
disk_size = 32 disk_size = 32
@ -34,14 +33,13 @@ proxmox_k8s_vms = [
} }
] ]
extra_packages = [] extra_packages = []
extra_runcmd = ["sudo ip addr add 192.168.1.199/24 dev eth0"] extra_runcmd = []
}, },
{ {
name = "k8s-worker-01" name = "k8s-worker-01"
vm_id = 3002 vm_id = 3002
node_name = "node" node_name = "node"
ip = "192.168.1.101/24" ip = "192.168.1.101/24"
ip3 = "192.168.1.201/24"
cores = 1 cores = 1
memory = 2000 memory = 2000
disk_size = 32 disk_size = 32
@ -55,6 +53,6 @@ proxmox_k8s_vms = [
} }
] ]
extra_packages = [] extra_packages = []
extra_runcmd = ["sudo ip addr add 192.168.1.201/24 dev eth0"] extra_runcmd = []
}, },
] ]

View File

@ -10,6 +10,19 @@ provider "vaultwarden" {
admin_token = var.vaultwarden_admin_token admin_token = var.vaultwarden_admin_token
} }
resource "vaultwarden_account_register" "vaultwarden-acount-fenix" {
name = "fenix"
email = var.vaultwarden_email
password = var.vaultwarden_master_password
}
resource "bitwarden_item_login" "administrative-user" {
name = "teste"
username = "teste"
password = "teste"
collection_ids = [vaultwarden_organization_collection.vaultwarden-collection-iac.id]
}
resource "vaultwarden_organization" "vaultwarden-organization-fenix-iac" { resource "vaultwarden_organization" "vaultwarden-organization-fenix-iac" {
name = "fenix-iac" name = "fenix-iac"
} }
@ -34,7 +47,7 @@ locals{
hosts_ini = <<EOT hosts_ini = <<EOT
[master] [master]
master1 ansible_host=${split("/", var.proxmox_k8s_vms[0].ip)[0]} ansible_user=${var.proxmox_k8s_vms[0].extra_users[0].name} ansible_ssh_pass=${var.proxmox_k8s_vms[0].extra_users[0].password} ansible_ssh_common_args='-o StrictHostKeyChecking=no' master-${replace(split("/", var.proxmox_k8s_vms[0].ip)[0], ".", "-")} ansible_host=${split("/", var.proxmox_k8s_vms[0].ip)[0]} ansible_user=${var.proxmox_k8s_vms[0].extra_users[0].name} ansible_ssh_pass=${var.proxmox_k8s_vms[0].extra_users[0].password} ansible_ssh_common_args='-o StrictHostKeyChecking=no'
[workers] [workers]
%{ for i, vm in var.proxmox_k8s_vms ~} %{ for i, vm in var.proxmox_k8s_vms ~}