Files
ansible_proxmox_VM/defaults/main.yml
Jose 0a1981194b refactor ♻️: Refactored the Debian VM template and cloning tasks for improved readability and maintainability.
Improved the structure and organization of the tasks to make it easier to understand and modify. Added comments and whitespace to enhance readability.
2025-11-15 12:59:20 +01:00

80 lines
1.4 KiB
YAML

---
vm_id: 150
hostname: debian-template-base
memory: 4096
cores: 4
bridge: vmbr0
storage: local-lvm
cpu_type: host
# Default MAC generator: avoids collisions
mac_base: "DE:AD:BE"
mac_suffix: "{{ '%02X:%02X' | format((vm_id // 256) % 256, vm_id % 256) }}"
mac_address: "{{ mac_base }}:{{ mac_suffix }}"
###############
# Networking
###############
ip_mode: dhcp # or static
ip_address: "192.168.1.60/24"
gateway: "192.168.1.1"
dns:
- "1.1.1.1"
- "8.8.8.8"
ipconfig0: "{{ 'ip=dhcp' if ip_mode == 'dhcp' else 'ip=' + ip_address + ',gw=' + gateway }}"
###############
# Packages
###############
packages:
- qemu-guest-agent
- curl
- htop
###############
# Cloud-Init user + SSH + password
###############
ci_user: debian
ci_password: "SecurePass123" # consider vault
ssh_key_path: "~/.ssh/id_rsa.pub"
timezone: "Europe/Berlin"
###############
# Optional Disk Resize
###############
resize_disk: true
resize_size: "16G"
###############
# GPU Options
###############
gpu_passthrough: false
gpu_device: "0000:01:00.0"
virtio_gpu: false
###############
# TPM + Secure Boot
###############
enable_tpm: false
# Convert VM to template?
make_template: true
# Create clones from the template?
create_clones: true
# List of clones
clones:
- id: 301
hostname: app01
ip: "192.168.1.81/24"
gateway: "192.168.1.1"
full: 1
- id: 302
hostname: app02
ip: "192.168.1.82/24"
gateway: "192.168.1.1"
full: 0