mirror of https://github.com/ansible/ansible.git
doc: use FQCN for vmware_rest examples
Use the collection name + the module name for clarity.pull/72163/head
parent
bb2c96aacc
commit
af7fd0f79d
@ -1,5 +1,5 @@
|
||||
- name: Add a floppy disk drive
|
||||
vcenter_vm_hardware_floppy:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_floppy:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
allow_guest_control: true
|
||||
register: my_floppy_drive
|
||||
register: my_floppy_drive
|
@ -1,9 +1,9 @@
|
||||
- name: Attach a VM to a dvswitch
|
||||
vcenter_vm_hardware_ethernet:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_ethernet:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
pci_slot_number: 4
|
||||
backing:
|
||||
type: DISTRIBUTED_PORTGROUP
|
||||
network: "{{ my_portgroup_info.dvs_portgroup_info.dvswitch1[0].key }}"
|
||||
start_connected: false
|
||||
register: _vm_hardware_ethernet_1
|
||||
register: vm_hardware_ethernet_1
|
@ -1,3 +1,3 @@
|
||||
- name: Build a list of all the clusters
|
||||
vcenter_cluster_info:
|
||||
register: all_the_clusters
|
||||
vmware.vmware_rest.vcenter_cluster_info:
|
||||
register: all_the_clusters
|
@ -1,3 +1,3 @@
|
||||
- name: Build a list of all the folders
|
||||
vcenter_folder_info:
|
||||
register: my_folders
|
||||
vmware.vmware_rest.vcenter_folder_info:
|
||||
register: my_folders
|
@ -1,6 +1,6 @@
|
||||
- name: Build a list of all the folders with the type VIRTUAL_MACHINE and called vm
|
||||
vcenter_folder_info:
|
||||
vmware.vmware_rest.vcenter_folder_info:
|
||||
filter_type: VIRTUAL_MACHINE
|
||||
filter_names:
|
||||
- vm
|
||||
register: my_folders
|
||||
register: my_folders
|
@ -1,5 +1,5 @@
|
||||
- name: Change vm-tools upgrade policy to MANUAL
|
||||
vcenter_vm_tools:
|
||||
vmware.vmware_rest.vcenter_vm_tools:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
upgrade_policy: MANUAL
|
||||
register: _result
|
||||
register: _result
|
@ -1,5 +1,5 @@
|
||||
- name: Change vm-tools upgrade policy to UPGRADE_AT_POWER_CYCLE
|
||||
vcenter_vm_tools:
|
||||
vmware.vmware_rest.vcenter_vm_tools:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
upgrade_policy: UPGRADE_AT_POWER_CYCLE
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: Collect information about a specific VM
|
||||
vcenter_vm_info:
|
||||
vmware.vmware_rest.vcenter_vm_info:
|
||||
vm: '{{ search_result.value[0].vm }}'
|
||||
register: test_vm1_info
|
||||
register: test_vm1_info
|
@ -1,4 +1,4 @@
|
||||
- name: Collect the hardware information
|
||||
vcenter_vm_hardware_info:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_info:
|
||||
vm: '{{ search_result.value[0].vm }}'
|
||||
register: my_vm1_hardware_info
|
||||
register: my_vm1_hardware_info
|
@ -1,5 +1,5 @@
|
||||
- name: Create a SATA adapter at PCI slot 34
|
||||
vcenter_vm_hardware_adapter_sata:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_adapter_sata:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
pci_slot_number: 34
|
||||
register: _sata_adapter_result_1
|
||||
register: _sata_adapter_result_1
|
@ -1,7 +1,7 @@
|
||||
- name: Create a new disk
|
||||
vcenter_vm_hardware_disk:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_disk:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
type: SATA
|
||||
new_vmdk:
|
||||
capacity: 320000
|
||||
register: my_new_disk
|
||||
register: my_new_disk
|
@ -1,5 +1,5 @@
|
||||
- name: Dedicate one core to the VM
|
||||
vcenter_vm_hardware_cpu:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_cpu:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
count: 1
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: Get VM storage policy
|
||||
vcenter_vm_storage_policy_info:
|
||||
vmware.vmware_rest.vcenter_vm_storage_policy_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,8 +1,8 @@
|
||||
- name: Get guest filesystem information
|
||||
vcenter_vm_guest_localfilesystem_info:
|
||||
vmware.vmware_rest.vcenter_vm_guest_localfilesystem_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
until:
|
||||
- _result is not failed
|
||||
retries: 60
|
||||
delay: 5
|
||||
delay: 5
|
@ -1,4 +1,4 @@
|
||||
- name: Get guest identity information
|
||||
vcenter_vm_guest_identity_info:
|
||||
vmware.vmware_rest.vcenter_vm_guest_identity_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: Get guest network interfaces information
|
||||
vcenter_vm_guest_networking_interfaces_info:
|
||||
vmware.vmware_rest.vcenter_vm_guest_networking_interfaces_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: Get guest network routes information
|
||||
vcenter_vm_guest_networking_routes_info:
|
||||
vmware.vmware_rest.vcenter_vm_guest_networking_routes_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: Get guest networking information
|
||||
vcenter_vm_guest_networking_info:
|
||||
vmware.vmware_rest.vcenter_vm_guest_networking_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: Get guest power information
|
||||
vcenter_vm_power_info:
|
||||
vmware.vmware_rest.vcenter_vm_power_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,5 +1,5 @@
|
||||
- name: Increase the memory of a VM
|
||||
vcenter_vm_hardware_memory:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_memory:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
size_MiB: 1080
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: List the SCSI adapter of a given VM
|
||||
vcenter_vm_hardware_adapter_scsi_info:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_adapter_scsi_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: List the cdrom devices on the guest
|
||||
vcenter_vm_hardware_cdrom_info:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_cdrom_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,5 +1,5 @@
|
||||
- name: Look up the VM called test_vm1 in the inventory
|
||||
register: search_result
|
||||
vcenter_vm_info:
|
||||
vmware.vmware_rest.vcenter_vm_info:
|
||||
filter_names:
|
||||
- test_vm1
|
||||
- test_vm1
|
@ -1,3 +1,3 @@
|
||||
- name: Retrieve a list of all the datastores
|
||||
vcenter_datastore_info:
|
||||
register: my_datastores
|
||||
vmware.vmware_rest.vcenter_datastore_info:
|
||||
register: my_datastores
|
@ -1,4 +1,4 @@
|
||||
- name: Retrieve details about the first cluster
|
||||
vcenter_cluster_info:
|
||||
vmware.vmware_rest.vcenter_cluster_info:
|
||||
cluster: "{{ all_the_clusters.value[0].cluster }}"
|
||||
register: my_cluster_info
|
||||
register: my_cluster_info
|
@ -1,4 +1,4 @@
|
||||
- name: Retrieve the disk information from the VM
|
||||
vcenter_vm_hardware_disk_info:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_disk_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,4 +1,4 @@
|
||||
- name: Retrieve the memory information from the VM
|
||||
vcenter_vm_hardware_memory_info:
|
||||
vmware.vmware_rest.vcenter_vm_hardware_memory_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,5 +1,5 @@
|
||||
- name: Turn the NIC's start_connected flag on
|
||||
vcenter_vm_hardware_ethernet:
|
||||
nic: '{{ _vm_hardware_ethernet_1.id }}'
|
||||
vmware.vmware_rest.vcenter_vm_hardware_ethernet:
|
||||
nic: '{{ vm_hardware_ethernet_1.id }}'
|
||||
start_connected: true
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
vm: '{{ test_vm1_info.id }}'
|
@ -1,4 +1,4 @@
|
||||
- name: Turn the power of the VM on
|
||||
vcenter_vm_power:
|
||||
vmware.vmware_rest.vcenter_vm_power:
|
||||
state: start
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
vm: '{{ test_vm1_info.id }}'
|
@ -1,6 +1,6 @@
|
||||
- name: Upgrade the VM hardware version
|
||||
vcenter_vm_hardware:
|
||||
vmware.vmware_rest.vcenter_vm_hardware:
|
||||
upgrade_policy: AFTER_CLEAN_SHUTDOWN
|
||||
upgrade_version: VMX_13
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: _result
|
||||
register: _result
|
@ -1,9 +1,9 @@
|
||||
- name: Wait until my VM is ready
|
||||
vcenter_vm_tools_info:
|
||||
vmware.vmware_rest.vcenter_vm_tools_info:
|
||||
vm: '{{ test_vm1_info.id }}'
|
||||
register: vm_tools_info
|
||||
until:
|
||||
- vm_tools_info is not failed
|
||||
- vm_tools_info.value.run_state != "NOT_RUNNING"
|
||||
- vm_tools_info.value.run_state == "RUNNING"
|
||||
retries: 60
|
||||
delay: 5
|
||||
delay: 5
|
@ -1,3 +1,3 @@
|
||||
- name: collect a list of the datacenters
|
||||
vcenter_datacenter_info:
|
||||
register: my_datacenters
|
||||
vmware.vmware_rest.vcenter_datacenter_info:
|
||||
register: my_datacenters
|
Loading…
Reference in New Issue