From b67bc43a70d785e2921aacd48ef120ccc53d245e Mon Sep 17 00:00:00 2001 From: Danny Bessems Date: Thu, 22 Dec 2022 19:44:33 +0100 Subject: [PATCH] Refactor vApp properties;Add dependency --- .../workloadcluster/tasks/nodetemplates.yml | 22 ++++++++----------- ansible/vars/metacluster.yml | 2 ++ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/nodetemplates.yml b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/nodetemplates.yml index 8a3f528..3987de9 100644 --- a/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/nodetemplates.yml +++ b/ansible/roles/firstboot/files/ansible_payload/roles/workloadcluster/tasks/nodetemplates.yml @@ -38,19 +38,15 @@ index_var: index - name: Add vApp properties on deployed VM's - community.vmware.vmware_guest: - name: "{{ item.instance.hw_name }}" - vapp_properties: - - id: guestinfo.dns.servers - value: ${dns:{{ vcenter_info.network }}} - - id: guestinfo.dns.domains - value: ${searchPath:{{ vcenter_info.network }}} - - id: guestinfo.interface.0.ip.0.address - value: ip:{{ vcenter_info.network }} - - id: guestinfo.interface.0.ip.0.netmask - value: ${netmask:{{ vcenter_info.network }}} - - id: guestinfo.interface.0.route.0.gateway - value: ${gateway:{{ vcenter_info.network }}} + ansible.builtin.shell: + cmd: >- + vappproperty-manager \ + -server {{ vapp['hv.fqdn'] }} \ + -username {{ vapp['hv.username'] }} \ + -password {{ vapp['hv.password'] }} \ + -dc {{ vcenter_info.datacenter }} \ + -network {{ vcenter_info.network }} \ + -vm {{ item.instance.hw_name }} when: existing_ova.results[index] is failed loop: "{{ ova_deploy.results }}" loop_control: diff --git a/ansible/vars/metacluster.yml b/ansible/vars/metacluster.yml index a416e9c..2fbc0c8 100644 --- a/ansible/vars/metacluster.yml +++ b/ansible/vars/metacluster.yml @@ -244,6 +244,8 @@ dependencies: extra_opts: --strip-components=2 - filename: yq url: http://github.com/mikefarah/yq/releases/download/v4.30.5/yq_linux_amd64 + - filename: vappprop-manager + url: https://code.spamasaurus.com/api/packages/djpbessems/generic/vappprop-manager/v0.1.0/vappprop-manager packages: apt: