Skip to content

Instantly share code, notes, and snippets.

Avatar
:shipit:

sky-joker sky-joker

:shipit:
View GitHub Profile
@sky-joker
sky-joker / main.yml
Last active Oct 24, 2021
This playbook is an example of cloning a new VM with vmwre.vmware_res
View main.yml
---
- 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 Jul 10, 2020
Netboxのprefixesから利用可能なIP一覧を取得するサンプルPlaybook
View sample.yml
---
- 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 Jun 28, 2020
Zabbixテンプレート
View zabbix_api_template.py
#!/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 Jun 20, 2020
Example playbook of apply ESXi patch
View ansible.cfg
[defaults]
host_key_checking=false
@sky-joker
sky-joker / vmware_prepare.yml
Last active Jan 27, 2021
Prepare CI environment for VMware infrastructure Playbook
View vmware_prepare.yml
---
- 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
View pr_test_66860_for_zabbix.yml
---
- 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 Feb 2, 2020
Zabbix Serverコンテナを複数のバージョン指定で起動させるPlaybook
View zabbix_servers_compose.yml
---
- 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"
View pyvmomi_connect_template.py
#!/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 Oct 24, 2021
VMwareのHTML Console SDKで使用するWebSocketのURLを生成するツール
View vmware_get_console_url.py
#!/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 Aug 15, 2019
owncloudを動かすコンテナのDockerfile
View Dockerfile
FROM centos:7
MAINTAINER sky-joker
RUN yum -y install gcc \
gcc-c++ \
mariadb \
mariadb-devel \
httpd httpd-devel \
libxml2-devel \