mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 22:02:50 +00:00
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:
committed by
Abhijeet Kasurde
parent
e96f90b440
commit
e2cac8cc93
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user