Skip to content

Commit 9f39576

Browse files
committed
fixing deploy_ovf_template assertions to be more accurate
1 parent 507f7a9 commit 9f39576

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
minor_changes:
2+
- deploy_ovf - Fixed the pre-check assertions for deploy_ovf_template var since it is required with content libraries and optional otherwise

roles/deploy_ovf/tasks/input_validation.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,21 @@
1010
quiet: true
1111
fail_msg: Variable must be set when using this role.
1212

13-
- name: Check Deployment Variables
13+
- name: Check Non-Library OVF Deployment Variables
1414
ansible.builtin.assert:
1515
that: >-
16-
(deploy_ovf_url is defined and (deploy_ovf_template is not defined and deploy_ovf_library is not defined)) or
17-
(deploy_ovf_url is not defined and (deploy_ovf_template is defined or deploy_ovf_library is defined))
16+
(deploy_ovf_url is defined and deploy_ovf_template is not defined) or
17+
(deploy_ovf_url is not defined and deploy_ovf_template is defined)
1818
quiet: true
19-
fail_msg: deploy_ovf_url is mutually exclusive with deploy_ovf_template and deploy_ovf_library.
19+
fail_msg: One of deploy_ovf_url or deploy_ovf_template is required when deploy_ovf_library is not used.
20+
when: deploy_ovf_library is not defined
21+
22+
- name: Check Content Library Deployment Variables
23+
ansible.builtin.assert:
24+
that: deploy_ovf_template is defined
25+
quiet: true
26+
fail_msg: deploy_ovf_template is required when deploy_ovf_library is defined.
27+
when: deploy_ovf_library is defined
2028

2129
- name: Check Datastore Variables
2230
ansible.builtin.assert:

roles/deploy_ovf/tasks/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
cluster: "{{ deploy_ovf_cluster_name | default(omit) }}"
1616

1717
name: "{{ deploy_ovf_vm_name }}"
18-
ovf: "{{ deploy_ovf_template }}"
18+
ovf: "{{ deploy_ovf_template | default(omit) }}"
1919
esxi_hostname: "{{ deploy_ovf_esxi_host | default(omit) }}"
2020
folder: "{{ deploy_ovf_folder | default(omit) }}"
2121
resource_pool: "{{ deploy_ovf_resource_pool | default(omit) }}"

0 commit comments

Comments
 (0)