From 8b6e0a5f594029835d07f210e429112922cca069 Mon Sep 17 00:00:00 2001 From: Jose Date: Tue, 9 Dec 2025 19:11:16 +0100 Subject: [PATCH] =?UTF-8?q?chore=20=F0=9F=93=A6:=20Update=20VM=20deploymen?= =?UTF-8?q?t=20configuration?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit updates the Ansible role for deploying VMs, defining two new VMs with specific configurations including IP addresses, VLAN assignments, and storage options. The changes also incorporate SSH key management from a file. --- tasks/testing.yml | 49 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 48 insertions(+), 1 deletion(-) diff --git a/tasks/testing.yml b/tasks/testing.yml index 9ca3b3d..f5be8cf 100644 --- a/tasks/testing.yml +++ b/tasks/testing.yml @@ -65,4 +65,51 @@ proxmox_template_vm_fedora_vlan: 50 # Set to true if you have slow storage to avoid file locks - proxmox_template_vm_slow_storage: true \ No newline at end of file + proxmox_template_vm_slow_storage: true + + - name: Deploy VMs + ansible.builtin.include_role: + name: joshrnoll.homelab.create_proxmox_vms + vars: + # Proxmox credentials + create_proxmox_vms_proxmox_username: "{{ proxmox_username }}" + create_proxmox_vms_proxmox_api_token_id: "{{ proxmox_api_token_id }}" + create_proxmox_vms_proxmox_api_token_secret: "{{ proxmox_api_token_secret }}" + + # VMs to be created + create_proxmox_vms_list: + - name: vm-01 + template: 5000 + vmid: 1000 + memory: 8192 + cores: 2 + node: node0 # The hostname of the node that the VM will be created on + ciuser: "{{ ciuser }}" + cipassword: "{{ cipassword }}" + sshkeys: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" + storage: local-lvm + disk_size: 32G + vlan: 50 + ip_address: 192.168.2.98/24 + gateway: 192.168.2.1 + nameservers: + - 192.168.2.100 + - 192.168.2.26 + + - name: vm-02 + vmid: 1001 + template: 5500 + memory: 4096 + cores: 1 + node: node0 # The hostname of the node that the VM will be created on + ciuser: "{{ ciuser }}" + cipassword: "{{ cipassword }}" + sshkeys: "{{ lookup('file', lookup('env','HOME') + '/.ssh/id_rsa.pub') }}" + storage: local-lvm + disk_size: 64G + vlan: 50 + ip_address: 192.168.0.99/24 + gateway: 192.168.2.1 + nameservers: + - 192.168.2.25 + - 192.168.0.26 \ No newline at end of file