This commit is contained in:
@ -0,0 +1,8 @@
|
||||
---
|
||||
- hosts: 127.0.0.1
|
||||
connection: local
|
||||
gather_facts: false
|
||||
# become: true
|
||||
roles:
|
||||
- vapp
|
||||
- network
|
@ -0,0 +1,41 @@
|
||||
- name: Store current vApp configuration
|
||||
ansible.builtin.shell:
|
||||
cmd: vmtoolsd --cmd "info-get guestinfo.ovfEnv"
|
||||
register: ovfEnv
|
||||
- name: Parse XML into variables
|
||||
community.general.xml:
|
||||
xmlstring: "{{ ovfEnv }}"
|
||||
namespaces:
|
||||
oe: http://schemas.dmtf.org/ovf/environment/1
|
||||
xpath: /Environment/PropertySection/Property
|
||||
content: oe:key
|
||||
|
||||
|
||||
# <?xml version="1.0" encoding="UTF-8"?>
|
||||
# <Environment
|
||||
# xmlns="http://schemas.dmtf.org/ovf/environment/1"
|
||||
# xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
# xmlns:oe="http://schemas.dmtf.org/ovf/environment/1"
|
||||
# xmlns:ve="http://www.vmware.com/schema/ovfenv"
|
||||
# oe:id=""
|
||||
# ve:vCenterId="vm-1171">
|
||||
# <PlatformSection>
|
||||
# <Kind>VMware ESXi</Kind>
|
||||
# <Version>7.0.1</Version>
|
||||
# <Vendor>VMware, Inc.</Vendor>
|
||||
# <Locale>en</Locale>
|
||||
# </PlatformSection>
|
||||
# <PropertySection>
|
||||
# <Property oe:key="deployment.type" oe:value="ubuntu-small"/>
|
||||
# <Property oe:key="guestinfo.dnsserver" oe:value="1.1.1.1"/>
|
||||
# <Property oe:key="guestinfo.gateway" oe:value="10.0.0.1"/>
|
||||
# <Property oe:key="guestinfo.hostname" oe:value="SRV01"/>
|
||||
# <Property oe:key="guestinfo.ipaddress" oe:value="10.0.0.84"/>
|
||||
# <Property oe:key="guestinfo.ntpserver" oe:value="0.pool.ntp.org,1.pool.ntp.org,2.pool.ntp.org"/>
|
||||
# <Property oe:key="guestinfo.prefixlength" oe:value="24"/>
|
||||
# <Property oe:key="guestinfo.rootpw" oe:value=""/>
|
||||
# </PropertySection>
|
||||
# <ve:EthernetAdapterSection>
|
||||
# <ve:Adapter ve:mac="00:50:56:8a:09:08" ve:network="Staging" ve:unitNumber="7"/>
|
||||
# </ve:EthernetAdapterSection>
|
||||
# </Environment>
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
# FOO
|
Reference in New Issue
Block a user