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 | |
def connect(hostname, username, password): | |
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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Copyright: (c) 2020, Abhijeet Kasurde <[email protected]> | |
# Copyright: (c) 2020, Ansible Project | |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
from __future__ import absolute_import, division, print_function | |
__metaclass__ = type | |
ANSIBLE_METADATA = { |
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
for i in `cat user.txt` | |
do | |
user=`echo $i | awk -F ":" '{print $1}'` | |
password=`echo $i | awk -F ":" '{print $2}'` | |
echo "Changing password for ${user}" | |
echo "${password}" | passwd --stdin ${user} | |
if [ $? -eq 0 ]; then | |
echo "Password changed for ${user}" | |
else | |
echo "Failed to change password for ${user}" |
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
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# PYTHON_ARGCOMPLETE_OK | |
# Copyright: (c) 2020, Jordan Borean (@jborean93) <[email protected]> | |
# MIT License (see LICENSE or https://opensource.org/licenses/MIT) | |
""" | |
Script that can be used to copy issues and PRs from the Ansible GitHub repo to it's target collection repo. Current | |
limitations are; |
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 | |
tasks: | |
- include_tasks: vmware_tag_manager.yml | |
vars: | |
vcenter_hostname: 'vc1.test.com' | |
vcenter_password: 'password' | |
vcenter_username: '[email protected]' | |
object_name: 'Cluster1' | |
object_type: ClusterComputeResource |
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 |
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: 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
<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
--- | |
- hosts: localhost | |
vars_files: | |
- vcenter_vars.yml | |
tasks: | |
- name: Create a Windows VM | |
vmware_guest: | |
validate_certs: False | |
hostname: '{{ vcenter_hostname }}' | |
username: '{{ vcenter_username }}' |