Skip to content

Instantly share code, notes, and snippets.

View jonhowe's full-sized avatar

Jon Howe jonhowe

View GitHub Profile
@jonhowe
jonhowe / export-propertygroup.ps1
Last active May 26, 2021 14:48
Export a property group from one vRA 7.6 instance to another instance
#This requires powervra
#documentation: https://jakkulabs.github.io/PowervRA/#powervra-3x
Install-Module -Name PowervRA -RequiredVersion 3.7.0 -Scope CurrentUser
#connect to source vra instance
Connect-vRAServer -Server source-vra-instance.fq.dn -Username "user" -IgnoreCertRequirements
#store the property group to a csv file
$propertygroup = Get-vRAPropertyDefinition -Id propertygroupid
@jonhowe
jonhowe / main.tf
Created July 5, 2021 22:18
VMware Provisioning using Hashicorp Terraform - Part 2 - main.tf
# Author: Jon Howe
# Blog: https://www.virtjunkie.com/vmware-provisioning-using-hashicorp-terraform-part-2/
# GitHub: https://github.com/jonhowe/Terraform-vSphere-VirtualMachine/blob/master/main.tf
# Vcenter connection parameters
provider "vsphere" {
user = var.vsphere_user
password = var.vsphere_password
vsphere_server = var.vsphere_server
allow_unverified_ssl = true
}
@jonhowe
jonhowe / variables.tf
Created July 5, 2021 22:19
VMware Provisioning using Hashicorp Terraform - Part 2 - variables.tf
# Author: Jon Howe
# Blog: https://www.virtjunkie.com/vmware-provisioning-using-hashicorp-terraform-part-2/
# GitHub: https://github.com/jonhowe/Terraform-vSphere-VirtualMachine/blob/master/variables.tf
variable "vsphere_server" {
description = "vsphere server for the environment - EXAMPLE: vcenter01.hosted.local"
}
variable "vsphere_user" {
description = "vsphere server for the environment - EXAMPLE: vsphereuser"
}
@jonhowe
jonhowe / output.tf
Created July 5, 2021 22:21
VMware Provisioning using Hashicorp Terraform - Part 2 - output.tf
# Author: Jon Howe
# Blog: https://www.virtjunkie.com/vmware-provisioning-using-hashicorp-terraform-part-2/
# GitHub: https://github.com/jonhowe/Terraform-vSphere-VirtualMachine/blob/master/output.tf
output "DC_ID" {
description = "id of vSphere Datacenter"
value = data.vsphere_datacenter.dc.id
}
output "Windows-VM" {
description = "VM Names"
@jonhowe
jonhowe / custom.tf
Created July 5, 2021 22:22
VMware Provisioning using Hashicorp Terraform - Part 2 - custom.tf
# Author: Jon Howe
# Blog: https://www.virtjunkie.com/vmware-provisioning-using-hashicorp-terraform-part-2/
# GitHub: https://github.com/jonhowe/Terraform-vSphere-VirtualMachine/blob/master/examples/multi-vm/main.tf
module "DC1" {
is_windows_image = "1"
source = "github.com/jonhowe/Terraform-vSphere-VirtualMachine/"
vsphere_server = "vcenter.home.lab"
vsphere_user = "administrator@vsphere.local"
vsphere_password = "VMware1!"
@jonhowe
jonhowe / nginx.conf
Created July 22, 2021 12:47
VROps -> OpsGenie/MSTeams - nginx.conf
#/etc/nginx/nginx.conf
worker_processes 1;
events {
worker_connections 1024;
}
http {
include mime.types;
@jonhowe
jonhowe / gunicorn.socket
Created July 22, 2021 12:51
VROps -> OpsGenie/MSTeams - gunicorn.socket
#/etc/systemd/system/gunicorn.socket
[Unit]
Description=gunicorn socket
[Socket]
ListenStream=/run/gunicorn.sock
# Our service won't need permissions for the socket, since it
# inherits the file descriptor by socket activation
# only the nginx daemon will need access to the socket
SocketUser=nobody
@jonhowe
jonhowe / gunicorn.service
Created July 22, 2021 12:52
VROps -> OpsGenie/MSTeams - gunicorn.service
#/etc/systemd/system/gunicorn.service
[Unit]
Description=gunicorn daemon
Requires=gunicorn.socket
After=network.target
[Service]
Type=notify
# the specific user that our service will run as
User=root
@jonhowe
jonhowe / installpackages.sh
Created July 22, 2021 13:56
VROps -> OpsGenie/MSTeams - Install Packages
#Install Prerequisite Packages from Repo
tdnf install wget curl python3 python3-xml python3-pip git nginx -y
#Clone git repository
git clone https://github.com/vmw-loginsight/webhook-shims.git
#Install pip packages
pip3 install uwsgi
pip3 install gunicorn
pip3 install -r ./loginsightwebhookdemo/webhook-shims/requirements.txt
@jonhowe
jonhowe / photon4-ks.cfg
Last active July 22, 2021 14:21
VROps -> OpsGenie/MSTeams - Photon 4 Kickstart File
{
"hostname": "photon",
"password": {
"crypted": false,
"text": "[yourpassword]"
},
"bootmode": "bios",
"disk": "/dev/sda",
"linux_flavor": "linux",
"packagelist_file": "packages_minimal.json",