From 4ffed83f2a27803765b1ec60e9315817d9fda1ef Mon Sep 17 00:00:00 2001 From: Mike Morency Date: Mon, 13 May 2024 09:23:53 -0400 Subject: [PATCH 1/3] fix missing docs and redundant vars --- .../fragments/32__mm-bugfix__provision_virtual_esxi.yml | 6 ++++++ roles/provision_virtual_esxi/README.md | 8 ++++++++ roles/provision_virtual_esxi/tasks/main.yml | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/32__mm-bugfix__provision_virtual_esxi.yml diff --git a/changelogs/fragments/32__mm-bugfix__provision_virtual_esxi.yml b/changelogs/fragments/32__mm-bugfix__provision_virtual_esxi.yml new file mode 100644 index 00000000..49bd0e5b --- /dev/null +++ b/changelogs/fragments/32__mm-bugfix__provision_virtual_esxi.yml @@ -0,0 +1,6 @@ +--- +bugfixes: + - provision_virtual_esxi - Added missing variable documentation + - >- + provision_virtual_esxi - Role had redundant variable `provision_virtual_esxi_iso_path` that was left from a name refactor. + It was updated to match the new name. The new variable name `provision_virtual_esxi_datastore_iso_path` is already mandatory diff --git a/roles/provision_virtual_esxi/README.md b/roles/provision_virtual_esxi/README.md index 3c56d058..68efc361 100644 --- a/roles/provision_virtual_esxi/README.md +++ b/roles/provision_virtual_esxi/README.md @@ -9,6 +9,9 @@ pyvomi ## Role Variables ### Auth +- **provision_virtual_esxi_hostname**: + - str, The name of the esxi or vcenter on which you want to deploy the vm. Required. + - **provision_virtual_esxi_username**: - str, The username to use to authenticate to the esxi or vcenter on which you want to deploy the vm. Required. @@ -64,6 +67,11 @@ pyvomi - int, The number of vCPUs to assign to this VM. - Default is 4 +- **provision_virtual_esxi_boot_firmware**: + - str, The type of boot firmware that the VM should be configured to use. 'bios' or 'uefi' + - Default value is 'bios' + + ## Dependencies - NA diff --git a/roles/provision_virtual_esxi/tasks/main.yml b/roles/provision_virtual_esxi/tasks/main.yml index 2167a2c0..d20ffed3 100644 --- a/roles/provision_virtual_esxi/tasks/main.yml +++ b/roles/provision_virtual_esxi/tasks/main.yml @@ -34,7 +34,7 @@ - name: Check VM Mandatory Variables Are Defined ansible.builtin.assert: that: - - provision_virtual_esxi_iso_path is defined + - provision_virtual_esxi_datastore_iso_path is defined quiet: true fail_msg: Variable must be set when using this role. - name: Deploy New ESXi Hosts From 98a7bce34fc4414b6d486191c7c89cda9f352be4 Mon Sep 17 00:00:00 2001 From: Mike Morency Date: Mon, 13 May 2024 09:29:41 -0400 Subject: [PATCH 2/3] update example and test playbooks --- roles/provision_virtual_esxi/README.md | 2 +- .../targets/provision_virtual_esxi_test/vars/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/roles/provision_virtual_esxi/README.md b/roles/provision_virtual_esxi/README.md index 68efc361..8b496edd 100644 --- a/roles/provision_virtual_esxi/README.md +++ b/roles/provision_virtual_esxi/README.md @@ -105,7 +105,7 @@ pyvomi - name: esxi-3 memory_mb: 24000 cpus: 12 - provision_virtual_esxi_iso_path: "[nfs-datastore-iso] esxi_8.iso" + provision_virtual_esxi_datastore_iso_path: "[nfs-datastore-iso] esxi_8.iso" ``` License diff --git a/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml b/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml index 3a30aee6..93c9db55 100644 --- a/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml +++ b/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml @@ -7,7 +7,7 @@ provision_virtual_esxi_port: 8989 provision_virtual_esxi_cluster: "DC0_C0" provision_virtual_esxi_folder: "/DC0/vm" provision_virtual_esxi_datacenter: "DC0" -provision_virtual_esxi_iso_path: "" +provision_virtual_esxi_datastore_iso_path: "" provision_virtual_esxi_vms: - name: esxi-1 - name: esxi-2 From 90073df8a57f13761889023c35d2a6dc5355b8d7 Mon Sep 17 00:00:00 2001 From: Mike Morency Date: Mon, 13 May 2024 09:37:13 -0400 Subject: [PATCH 3/3] integration test fix --- .../targets/provision_virtual_esxi_test/vars/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml b/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml index 93c9db55..7b271f62 100644 --- a/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml +++ b/tests/integration/targets/provision_virtual_esxi_test/vars/main.yml @@ -7,7 +7,7 @@ provision_virtual_esxi_port: 8989 provision_virtual_esxi_cluster: "DC0_C0" provision_virtual_esxi_folder: "/DC0/vm" provision_virtual_esxi_datacenter: "DC0" -provision_virtual_esxi_datastore_iso_path: "" +provision_virtual_esxi_datastore_iso_path: "[LocalDS_0] foo.iso" provision_virtual_esxi_vms: - name: esxi-1 - name: esxi-2