View main.yml
This file contains 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: This playbook is an example of cloning a new VM with vmwre.vmware_res | |
hosts: localhost | |
gather_facts: false | |
vars: | |
vcenter_hostname: change me to vcenter host or ip | |
vcenter_username: administrator@vsphere.local | |
vcenter_password: change me to user password | |
folder: F0 | |
template_vm: test_vm1 |
View get-guestos-processes.py
This file contains 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 python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim, vmodl | |
from getpass import getpass | |
import ssl | |
import atexit | |
import argparse | |
import sys | |
def options(): |
View ansible-tower-api-tool.py
This file contains 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 python3 | |
from getpass import getpass | |
import argparse | |
import sys | |
import json | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
def options(): |
View clone_vm.yml
This file contains 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: ESXi single clone vm demo | |
hosts: all | |
gather_facts: no | |
vars: | |
vm_password: !vault | | |
$ANSIBLE_VAULT;1.1;AES256 | |
(snip) | |
tasks: | |
- name: Get datastore infomation |
View get_vm_list.py
This file contains 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/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim | |
import ssl | |
import atexit | |
if __name__ == '__main__': | |
# 接続情報 | |
host = 'IP or FQDN' | |
username = 'administrator@vsphere.local' |
View vm_hw_version.py
This file contains 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/python3 | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim | |
import ssl | |
import atexit | |
if __name__ == '__main__': | |
# 接続情報 | |
host = 'vCenter IP or Host Name' | |
username = 'administrator@vsphere.local' |
View get_ansible_tower_authtoken.py
This file contains 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 python3 | |
import json | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
if __name__ == '__main__': | |
url = "https://ansible tower ip or fqdn/api/v2/authtoken/" | |
headers = { "Content-Type": "application/json" } | |
data = { |
View get_ansible_tower_hostlist.py
This file contains 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 python3 | |
import json | |
import requests | |
from requests.packages.urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(InsecureRequestWarning) | |
if __name__ == '__main__': | |
url = "https://ansible tower ip or fqdn/api/v2/authtoken/" | |
headers = { "Content-Type": "application/json" } | |
data = { |
View git_operation.yml
This file contains 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: git test | |
hosts: localhost | |
gather_facts: no | |
vars: | |
# git config | |
#repo: "https://{{ git_user }}:{{ git_pass}}@gitlab.com/username/repo.git" | |
#remote_repo_name: origin | |
#git_user: username | |
#git_pass: password |
View vmware_get_console_url.py
This file contains 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 | |
from __future__ import absolute_import, division, print_function | |
from pyVim.connect import SmartConnect, Disconnect | |
from pyVmomi import vim | |
from getpass import getpass | |
import ssl | |
import atexit | |
import argparse | |
import sys |
NewerOlder