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

@ -42,10 +42,8 @@ extends_documentation_fragment: vmware.documentation
'''
EXAMPLES = '''
# Example vmware_dns_config command from Ansible Playbooks
- name: Configure ESXi hostname and DNS servers
local_action:
module: vmware_dns_config
vmware_dns_config:
hostname: esxi_hostname
username: root
password: your_password
@ -54,6 +52,7 @@ EXAMPLES = '''
dns_servers:
- 8.8.8.8
- 8.8.4.4
delegate_to: localhost
'''
try:
from pyVmomi import vim, vmodl