Fix all VMware examples to use delegate_to (#43426)

Some users have problems using the VMware modules because they use the
vCenter as target, and Ansible uses SSH to connect to the targets.

Eventually we need to update the VMware guide to explain how the modules
work, but the first fix is to update the examples.

(We should backport to v2.6 and v2.5 too)
This commit is contained in:
Dag Wieers 2018-08-01 05:40:57 +02:00 committed by Abhijeet Kasurde
commit e2cac8cc93
56 changed files with 161 additions and 67 deletions

View file

@ -176,6 +176,7 @@ EXAMPLES = '''
esxi:
datacenter: MyDatacenter
hostname: esx001.mydomain.local
delegate_to: localhost
# Reconfigure the CPU and Memory on the newly created VM
# Will return the changes made
@ -208,6 +209,7 @@ EXAMPLES = '''
esxi:
datacenter: MyDatacenter
hostname: esx001.mydomain.local
delegate_to: localhost
# Deploy a guest from a template
- vsphere_guest:
@ -221,15 +223,16 @@ EXAMPLES = '''
resource_pool: "/Resources"
vm_extra_config:
folder: MyFolder
delegate_to: localhost
# Task to gather facts from a vSphere cluster only if the system is a VMware guest
- vsphere_guest:
vcenter_hostname: vcenter.mydomain.local
username: myuser
password: mypass
guest: newvm001
vmware_guest_facts: yes
delegate_to: localhost
---
# Typical output of a vsphere_facts run on a guest
@ -273,6 +276,7 @@ EXAMPLES = '''
guest: newvm001
state: absent
force: yes
delegate_to: localhost
'''
import os