- name: Store current ovfEnvironment ansible.builtin.shell: cmd: /usr/bin/vmtoolsd --cmd "info-get guestinfo.ovfEnv" register: ovfenv - name: Parse XML for vApp properties community.general.xml: xmlstring: "{{ ovfenv.stdout }}" namespaces: ns: http://schemas.dmtf.org/ovf/environment/1 xpath: /ns:Environment/ns:PropertySection/ns:Property content: attribute register: ovfenv - name: Assign vApp properties to dictionary ansible.builtin.set_fact: vapp: >- {{ vapp | default({}) | combine({((item.values() | list)[0].values() | list)[0]: ((item.values() | list)[0].values() | list)[1]}) }} loop: "{{ ovfenv.matches }}" no_log: true