diff --git a/lxc/grail-2/user-data.yaml b/lxc/grail-2/user-data.yaml index 013b2ac..c512d5a 100644 --- a/lxc/grail-2/user-data.yaml +++ b/lxc/grail-2/user-data.yaml @@ -10,11 +10,20 @@ users: ssh_authorized_keys: - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDHcixZfdNvEI8RMqRW4kD4Dt+jSyWF8+2v940/j5v2tvHnn9wjVN90bVp8w4yhd/gHQuFkyLZ/hpSQ7X2zuLSbSUP7tl7y9SG8ZYQJC4vIlhdnV2h6HcGGvo0eiof4RbyCcF/w7TDlxmxjWcEaVYL0QTuQUZWgtYhnLKpJZFynsHoxG9p/7/6vOxVmHuZWvDH8plAVrpY0ecoX088n45wwxiFN5gXKLrKKq3eH5dlYoWeYgZrv6jkL3w+c3/1jsxU4qUOFfA3isyxnbv4ZZeVZJir7yY0dKI/Oz65/L/EfgZhJ6YGHgH/Kks8SbXbXY41kDQLTkO7gHZ3ZrKK45uHbLnHuF7DKo3GVA2KUwyFWQi/aw6sRaH18TLE/Z9NpEPj144mNm1z6uqn5lhY4ws6qwz6ae93Z/eXtT/J4Orbv4mDrDPCNhT9LEWC4rjkN7hpiXhasKduK2HzB5L6ym4J+wlx0VspJOqG7Txv5gaGe3Wo4FrFv4iGvvSMUF4eDMPc= ryan@AnsibleTerraform sudo: ALL=(ALL) NOPASSWD:ALL + - name: ansible + groups: + - sudo + shell: /bin/bash + ssh_authorized_keys: + - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIDjUKlG9UIIyOswtWOuoqMd4UCpozP9EisEtpO+hXM6L ryan@AnsibleTerraform + sudo: ALL=(ALL) NOPASSWD:ALL package_update: true packages: - qemu-guest-agent - net-tools - curl + - ansible + - git runcmd: - systemctl enable qemu-guest-agent - systemctl start qemu-guest-agent diff --git a/lxc/openbao/main.tf b/lxc/openbao/main.tf new file mode 100644 index 0000000..98976fa --- /dev/null +++ b/lxc/openbao/main.tf @@ -0,0 +1,95 @@ +terraform { + required_providers { + proxmox = { + source = "bpg/proxmox" + version = "0.106.0" + } + } +} + +# ------------------------------------------------------------------ +# Optional second disk – create it only when the flag is true. +# ------------------------------------------------------------------ +resource "proxmox_virtual_environment_container" "example_template" { + description = "Managed by Terraform" + start_on_boot = var.start_on_boot + unprivileged = var.unprivileged + + features { + nesting = var.nesting_enabled + } + + wait_for_ip { + ipv4 = true + } + + # ---- Disk(s) ---------------------------------------------------- + disk { + datastore_id = var.datastore_id # <- primary disk + size = var.disk_size_gb # in GB + } + + # ------------------------------------------------------------------ + # Mount points – uncomment and set if you need to mount a volume. + # ------------------------------------------------------------------ + #mount_point { + # volume = var.mount_volume + # size = "4G" + # path = "/mnt/local" + #} + + # ---- Initialization ------------------------------------------------- + initialization { + dns { + servers = ["1.1.1.1", "8.8.8.8"] + } + + hostname = var.hostname + + ip_config { + ipv4 { + address = var.ip_address + gateway = var.gateway + } + } + + user_account { + password = var.password + # keys = [trimspace(tls_private_key.example.public_key_openssh)] + } + } + + # ---- Network ---------------------------------------------------- + network_interface { + name = "veth0" + mtu = 1450 + } + + node_name = var.node_name + + operating_system { + template_file_id = var.template_file_id + type = "debian" + } + + tags = [ + "deb13", + "terraform", + ] + + cpu { + cores = var.cores + } + + memory { + dedicated = var.memory + swap = var.swap + } + + + startup { + order = "3" + up_delay = "60" + down_delay = "60" + } +} diff --git a/lxc/openbao/vars.tf b/lxc/openbao/vars.tf new file mode 100644 index 0000000..98b0d90 --- /dev/null +++ b/lxc/openbao/vars.tf @@ -0,0 +1,52 @@ +# --------------------------------------------------------------- +# General container settings (things that rarely change) +# --------------------------------------------------------------- +variable "start_on_boot" { + type = bool + default = true +} + +variable "unprivileged" { + type = bool + default = true +} + +variable "nesting_enabled" { + type = bool + default = true +} + +# --------------------------------------------------------------- +# Disk sizes (primary + optional) +# --------------------------------------------------------------- +variable "datastore_id" { + type = string + default = "local-lvm" +} + +variable "disk_size_gb" { + type = number + default = 64 +} + +# --------------------------------------------------------------- +# Initialization specifics +# --------------------------------------------------------------- +variable "hostname" { default = "openbao" } +variable "ip_address" { default = "192.168.0.64/24" } +variable "gateway" { default = "192.168.0.1" } +variable "password" { default = "example" } +variable "memory" { default = 2048 } # Sets dedicated RAM to 2048 MB (2 GB) +variable "swap" { default = 1024 } # Sets swap space to 1024 MB (1 GB) +variable "cores" { default = 4 } + +# --------------------------------------------------------------- +# Node & template file +# --------------------------------------------------------------- +variable "node_name" { default = "watari" } +variable "template_file_id" { default = "local:vztmpl/debian-13-standard_13.4-sudo_amd64.tar.zst" } + +# --------------------------------------------------------------- +# (Optional) Mount point volume name – set if you enable mounts +# --------------------------------------------------------------- +# variable "mount_volume" { default = "" } diff --git a/sops_3.13.0_amd64.deb b/sops_3.13.0_amd64.deb new file mode 100644 index 0000000..ea7433e Binary files /dev/null and b/sops_3.13.0_amd64.deb differ