Skip to content

Commit 8cd6029

Browse files
committed
The video card can be configured.
1 parent e1de806 commit 8cd6029

File tree

3 files changed

+27
-5
lines changed

3 files changed

+27
-5
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## v6.2.0 (2025-09-18)
4+
5+
Added support for basic video card configuration.
6+
37
## v6.1.0 (2025-08-23)
48

59
Added support for more recent Ubuntu versions (22.04, 24.04, 25.04), dropped support for outdated Ubuntu versions.

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ This role adds support for these features.
1818
- Sets the hostname.
1919
- Adds one or more ssh public keys and/or a password for the default user "ubuntu" so that Ansible can connect to the new machine.
2020
- Optionally adjusts the hardware, e.g. number of CPUs or memory, see [vmware_guest](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_module.html#parameters) for possible customizations.
21+
- Optionally adjusts the video card configuration (memory, 3D accelleration) see [vmware_guest_video](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_video_module.html#parameters) for details (not all parameters are supported).
2122
- Optionally sets VM notes (annotations), VM [configuration file parameters](https://techdocs.broadcom.com/us/en/vmware-cis/vsphere/vsphere/7-0/edit-virtual-machine-configuration-file-parameters.html) and/or VM custom attributes.
2223
- Disk size may be increased (defaults to 10GB), additional disks may be created and added.
2324
- Optionally changes the dynamic IP address to a static one (taken either from the playbook or from DNS).
@@ -92,6 +93,7 @@ Role Variables
9293
- Use `password` to set a password for the user "ubuntu".
9394
At least one of `ssh_keys` and `password` has to be specified so that Ansible can connect to the new machine.
9495
- The hardware can be specified with `hardware`, containing a dictionary as specified in [vmware_guest](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_module.html#parameters).
96+
- The video card configuration can be specified with `video_card`, containing a dictionary as specified in [vmware_guest_video](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_video_module.html#parameters). Supported parameters: `video_memory_mb`, `enable_3D`, `renderer_3D`, `memory_3D_mb`.
9597
- Disk size may be adjusted with `disk`. This parameter accepts a list of disk specifications as documented in [vmware_guest_disk](https://docs.ansible.com/ansible/latest/collections/community/vmware/vmware_guest_disk_module.html#parameters).
9698
The first disk corresponds to the imported virtual disk. Its size may only be increased.
9799
See the example playbook below for usage.
@@ -144,15 +146,13 @@ playbook:
144146
vmware_datacenter: your-datacenter
145147
vmware_datastore: your-datastore
146148
vmware_folder: your-datacenter/vm/some-folder
147-
ova_file: ubuntu-20.04-server-cloudimg-amd64.ova
149+
ova_file: ubuntu-24.04-server-cloudimg-amd64.ova
148150
hardware:
149151
num_cpus: 4
150152
memory_mb: 2048
153+
video_card:
154+
video_memory_mb: 32
151155
annotation: 'sample VM based on Ubuntu Cloud Image'
152-
# this avoids excessive syslog messages from multipathd under Ubuntu 20.04
153-
advanced_settings:
154-
- key: disk.EnableUUID
155-
value: 'TRUE'
156156
customvalues:
157157
- key: 'yourkey'
158158
value: 'yourvalue'

tasks/main.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,24 @@
4343
state: present
4444
delegate_to: localhost
4545

46+
- name: Configure video card settings
47+
tags: configure-vm
48+
community.vmware.vmware_guest_video:
49+
hostname: "{{ vcenter_hostname | default(omit) }}"
50+
username: "{{ vcenter_username | default(omit) }}"
51+
password: "{{ vcenter_password | default(omit) }}"
52+
validate_certs: "{{ vcenter_validate_certs | default(omit) }}"
53+
datacenter: "{{ vmware_datacenter }}"
54+
name: "{{ vm_guestname }}"
55+
gather_video_facts: "{{ video_card.gather_video_facts | default(false) }}"
56+
use_auto_detect: "{{ video_card.use_auto_detect | default(false) }}"
57+
display_number: "{{ video_card.display_number | default(1) }}"
58+
video_memory_mb: "{{ video_card.video_memory_mb | default(omit) }}"
59+
enable_3D: "{{ video_card.enable_3D | default(omit) }}"
60+
renderer_3D: "{{ video_card.renderer_3D | default(omit) }}"
61+
memory_3D_mb: "{{ video_card.memory_3D_mb | default(omit) }}"
62+
delegate_to: localhost
63+
4664
- name: Configure disks
4765
tags: configure-vm
4866
community.vmware.vmware_guest_disk:

0 commit comments

Comments
 (0)