This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
gather_facts: no | |
tasks: | |
- name: Create category for backup | |
community.vmware.vmware_category: | |
category_name: "backup_category" | |
category_description: "Backup Category Description" | |
category_cardinality: "multiple" | |
associable_object_types: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyVim.connect import SmartConnect, Disconnect | |
import ssl | |
import atexit | |
from pyVmomi import vim, vmodl, VmomiSupport | |
def connect(hostname, username, password, port): | |
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) | |
context.verify_mode = ssl.CERT_NONE | |
si = SmartConnect(host=hostname, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pyVim.connect import SmartConnect, Disconnect | |
import ssl | |
import atexit | |
from pyVmomi import vim | |
# vim.vm.GuestOsDescriptor.GuestOsIdentifier | |
def connect(hostname, username, password, port): | |
context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) | |
context.verify_mode = ssl.CERT_NONE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
import os | |
import shutil | |
url = "" | |
response = requests.get(url) | |
soup = BeautifulSoup(response.text, "html.parser") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
gather_facts: no | |
vars_files: | |
- vcenter_vars.yml | |
tasks: | |
- name: Create a DRS anti-affinity rule for Asia-Cluster1 | |
community.vmware.vmware_vm_vm_drs_rule: | |
validate_certs: False | |
hostname: '{{ vcenter_hostname }}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
vars_files: | |
- vcenter_vars.yml | |
tasks: | |
- name: Create a Windows VM | |
vmware_guest: | |
validate_certs: False | |
hostname: '{{ vcenter_hostname }}' | |
username: '{{ vcenter_username }}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<FirstLogonCommands> | |
<SynchronousCommand wcm:action="add"> | |
<Order>1</Order> | |
<CommandLine>powershell -ExecutionPolicy ByPass Invoke-Expression (Invoke-WebRequest -Uri http://raw.githubusercontent.com/ansible/ansible/devel/examples/scripts/ConfigureRemotingForAnsible.ps1)</CommandLine> | |
</SynchronousCommand> | |
<SynchronousCommand wcm:action="add"> | |
<Order>2</Order> | |
<CommandLine>powerShell "Invoke-WebRequest -Uri http://packages.vmware.com/tools/esx/6.7u2/windows/x64/VMware-tools-10.3.5-10430147-x86_64.exe -OutFile C:\Windows\temp\VMware-tools-10.3.5-10430147-x86_64.exe"</CommandLine> | |
</SynchronousCommand> | |
<SynchronousCommand wcm:action="add"> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- name: Start SSH service setting for an ESXi Host in given Cluster | |
vmware_host_service_manager: | |
hostname: '{{ vcenter_hostname }}' | |
username: '{{ vcenter_username }}' | |
password: '{{ vcenter_password }}' | |
esxi_hostname: esxi_name | |
service_name: TSM-SSH | |
state: present |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- hosts: localhost | |
gather_facts: no | |
vars_files: | |
- vcenter_vars.yml | |
vars: | |
hostname: kickstart_vm | |
tasks: | |
- name: Boot VM with CentOS 7 installation iso in CDROM | |
vmware_guest: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- name: Generate a KVM enabled VMWare VCSA VM under libvirt | |
hosts: 127.0.0.1 | |
connection: local | |
vars: | |
- reqpkgs_apt: | |
- bsdtar | |
- libguestfs-tools | |
- qemu-utils | |
- virtinst |