Compare commits
8 Commits
18c4f99fd8
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 562a8e2e93 | |||
| 9cdbf83b4a | |||
| 04fd6fd008 | |||
| cb0a5869d9 | |||
| dc0e126a37 | |||
| a4bd2e3266 | |||
| ad6116e3a1 | |||
| 460b2f4c36 |
15
.drone.yml
15
.drone.yml
@@ -35,21 +35,6 @@ steps:
|
|||||||
event:
|
event:
|
||||||
- pull_request
|
- pull_request
|
||||||
|
|
||||||
- name: terraform apply for pull request
|
|
||||||
image: hashicorp/terraform:1.5
|
|
||||||
commands:
|
|
||||||
- terraform -chdir=infrastructure validate
|
|
||||||
- terraform -chdir=infrastructure plan -out tfapply
|
|
||||||
- terraform -chdir=infrastructure apply -auto-approve tfapply
|
|
||||||
environment:
|
|
||||||
TF_VAR_virtual_environment_endpoint:
|
|
||||||
from_secret: virtual_environment_endpoint
|
|
||||||
TF_VAR_virtual_environment_api_token:
|
|
||||||
from_secret: virtual_environment_api_token
|
|
||||||
when:
|
|
||||||
event:
|
|
||||||
- pull_request
|
|
||||||
|
|
||||||
- name: Terraform infrastructure syntax check
|
- name: Terraform infrastructure syntax check
|
||||||
image: hashicorp/terraform:1.5
|
image: hashicorp/terraform:1.5
|
||||||
commands:
|
commands:
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ resource "proxmox_virtual_environment_vm" "devops" {
|
|||||||
datastore_id = "local"
|
datastore_id = "local"
|
||||||
size = 30
|
size = 30
|
||||||
ssd = true
|
ssd = true
|
||||||
|
discard = "ignore"
|
||||||
iothread = true
|
iothread = true
|
||||||
interface = "scsi0"
|
interface = "scsi0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ resource "proxmox_virtual_environment_vm" "infra" {
|
|||||||
datastore_id = "local"
|
datastore_id = "local"
|
||||||
size = 30
|
size = 30
|
||||||
ssd = true
|
ssd = true
|
||||||
|
discard = "ignore"
|
||||||
iothread = true
|
iothread = true
|
||||||
interface = "scsi0"
|
interface = "scsi0"
|
||||||
}
|
}
|
||||||
|
|||||||
97
infrastructure/service.tf
Normal file
97
infrastructure/service.tf
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
# proxmox_virtual_environment_vm.devops:
|
||||||
|
resource "proxmox_virtual_environment_vm" "services" {
|
||||||
|
acpi = true
|
||||||
|
vm_id = "114"
|
||||||
|
machine = "q35"
|
||||||
|
name = "services"
|
||||||
|
node_name = "proxmox"
|
||||||
|
scsi_hardware = "virtio-scsi-pci"
|
||||||
|
started = true
|
||||||
|
tablet_device = false
|
||||||
|
tags = []
|
||||||
|
template = false
|
||||||
|
|
||||||
|
clone {
|
||||||
|
vm_id = 9999
|
||||||
|
}
|
||||||
|
|
||||||
|
agent {
|
||||||
|
enabled = true
|
||||||
|
timeout = "15m"
|
||||||
|
trim = false
|
||||||
|
type = "virtio"
|
||||||
|
}
|
||||||
|
|
||||||
|
cpu {
|
||||||
|
cores = 2
|
||||||
|
flags = []
|
||||||
|
hotplugged = 0
|
||||||
|
numa = false
|
||||||
|
sockets = 1
|
||||||
|
type = "host"
|
||||||
|
units = 1024
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
disk {
|
||||||
|
datastore_id = "local"
|
||||||
|
size = 30
|
||||||
|
ssd = true
|
||||||
|
iothread = true
|
||||||
|
discard = "ignore"
|
||||||
|
interface = "scsi0"
|
||||||
|
}
|
||||||
|
|
||||||
|
initialization {
|
||||||
|
datastore_id = "local"
|
||||||
|
interface = "ide2"
|
||||||
|
|
||||||
|
ip_config {
|
||||||
|
ipv4 {
|
||||||
|
address = "10.20.1.9/16"
|
||||||
|
gateway = "10.20.0.1"
|
||||||
|
}
|
||||||
|
ipv6 {
|
||||||
|
address = "auto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
user_account {
|
||||||
|
keys = var.virtual_environment_sshkeys
|
||||||
|
username = "tim"
|
||||||
|
password = random_password.devops_vm_password.result
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
memory {
|
||||||
|
dedicated = 4096
|
||||||
|
floating = 0
|
||||||
|
shared = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
network_device {
|
||||||
|
bridge = "vmbr0"
|
||||||
|
enabled = true
|
||||||
|
firewall = false
|
||||||
|
model = "virtio"
|
||||||
|
mtu = 0
|
||||||
|
rate_limit = 0
|
||||||
|
vlan_id = 0
|
||||||
|
}
|
||||||
|
|
||||||
|
vga {
|
||||||
|
enabled = true
|
||||||
|
memory = 16
|
||||||
|
type = "std"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resource "random_password" "services_vm_password" {
|
||||||
|
length = 16
|
||||||
|
override_special = "_%@"
|
||||||
|
special = true
|
||||||
|
}
|
||||||
|
|
||||||
|
output "services_vm_password" {
|
||||||
|
value = random_password.devops_vm_password.result
|
||||||
|
sensitive = true
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user