Further gemma fixes

This commit is contained in:
2026-06-10 18:18:47 +02:00
parent 51fd19f45a
commit 03ced3d1b1
2 changed files with 14 additions and 16 deletions
+1 -8
View File
@@ -9,14 +9,6 @@
- kvm_host_setup
tasks:
- name: Provision each VM
include_role:
name: os_config
vars:
vm_name: "{{ item.name }}"
os_type: "{{ item.os_type }}"
loop: "{{ vms }}"
- name: Launch each VM
include_role:
name: vm_provision
@@ -28,3 +20,4 @@
ram: "{{ item.ram }}"
disk: "{{ item.disk }}"
loop: "{{ vms }}"
@@ -41,6 +41,18 @@
args:
creates: "{{ vm_images_dir }}/{{ vm_name }}.qcow2"
- name: Customize VM image (Inject User/SSH/Sudo)
shell: |
virt-customize -a {{ vm_images_dir }}/{{ vm_name }}.qcow2 \
--username {{ vm_user }} \
--password {{ vm_password }} \
--ssh-insert {{ vm_user }}:keys={{ vm_ssh_public_key | replace('~', lookup('env', 'HOME')) }} \
--run-command "usermod -aG wheel {{ vm_user }}" && \
touch {{ vm_images_dir }}/{{ vm_name }}.customized
become: yes
args:
creates: "{{ vm_images_dir }}/{{ vm_name }}.customized"
- name: Provision VM using virt-install
shell: |
virt-install \
@@ -53,14 +65,7 @@
--network network=default \
--graphics none \
--noautoconsole \
--boot uefi \
--cloud-init user-data=/tmp/{{ vm_name }}_user-data
args:
--boot uefi
args:
creates: "/etc/libvirt/qemu/{{ vm_name }}.xml"
- name: Attach configuration to VM
debug:
msg: "Configuration is now handled by virt-install --cloud-init flag."
when: false # This task is now obsolete
become: yes