Skip to content

Instantly share code, notes, and snippets.

View sky-joker's full-sized avatar
:shipit:

sky-joker sky-joker

:shipit:
View GitHub Profile
@sky-joker
sky-joker / main.yml
Last active August 9, 2023 21:54
This playbook is an example of cloning a new VM with vmwre.vmware_res
---
- 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
@sky-joker
sky-joker / sample.yml
Created July 10, 2020 16:05
Netboxのprefixesから利用可能なIP一覧を取得するサンプルPlaybook
---
- name: "example playbook"
hosts: localhost
gather_facts: no
vars:
netbox_url: http:/netbox ip or fqdn/api/ipam/prefixes/
netbox_token: change me
target_prefix: "100.64.0.0/24"
module_defaults:
uri:
@sky-joker
sky-joker / zabbix_api_template.py
Created June 28, 2020 03:52
Zabbixテンプレート
#!/usr/bin/env python
from zabbix_api import ZabbixAPI
if __name__ == "__main__":
url = ""
user = ""
passwd = ""
zapi = ZabbixAPI(server=url)
zapi.login(user, passwd)
@sky-joker
sky-joker / ansible.cfg
Last active June 20, 2020 11:03
Example playbook of apply ESXi patch
[defaults]
host_key_checking=false
@sky-joker
sky-joker / vmware_prepare.yml
Last active January 27, 2021 10:32
Prepare CI environment for VMware infrastructure Playbook
---
- name: Prepare CI environment for VMware infrastructure
hosts: localhost
gather_facts: no
vars:
# common params
vcenter_hostname: vcenter server
vcenter_username: administrator@vsphere.local
vcenter_password: password
datacenter: datacenter name
---
- name: "PR test for #66860 (https://github.com/ansible/ansible/pull/66860)"
hosts: localhost
gather_facts: no
vars:
url: http://127.0.0.1/zabbix # specify zabbix 3.0.x url
user: admin
passwd: zabbix
tasks:
- name: delete host from zabbix server
@sky-joker
sky-joker / zabbix_servers_compose.yml
Created February 2, 2020 14:09
Zabbix Serverコンテナを複数のバージョン指定で起動させるPlaybook
---
- name: zabbix containers provisione playbook
hosts: localhost
gather_facts: no
vars:
state: present
#state: absent
subnet: "192.168.100.0/24"
zabbix_version:
- "3.0.29"
@sky-joker
sky-joker / pyvmomi_connect_template.py
Created November 6, 2019 13:30
vCenter connect template
#!/usr/bin/env python
from pyVim.connect import SmartConnect, Disconnect
from pyVmomi import vim, vmodl
import ssl
import atexit
host = ''
username = ''
password = ''
mob = vim.VirtualMachine
@sky-joker
sky-joker / vmware_get_console_url.py
Last active October 24, 2021 18:17
VMwareのHTML Console SDKで使用するWebSocketのURLを生成するツール
#!/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
@sky-joker
sky-joker / Dockerfile
Last active August 15, 2019 03:17
owncloudを動かすコンテナのDockerfile
FROM centos:7
MAINTAINER sky-joker
RUN yum -y install gcc \
gcc-c++ \
mariadb \
mariadb-devel \
httpd httpd-devel \
libxml2-devel \