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
--- | |
nsxt_ip_sets: | |
- display_name: google_dns | |
ip_addresses: | |
- '8.8.8.8' | |
- '8.8.4.4' | |
state: present | |
nsxt_firewall_section: | |
- display_name: Default rules | |
stateful: True |
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
--- | |
hostname: nsxt-manager.lab.local | |
username: admin | |
password: nsxt-password | |
validate_certs: False |
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: 127.0.0.1 | |
connection: local | |
tasks: | |
- name: Create a new IP Set | |
nsxt_ip_sets: | |
hostname: "{{ hostname }}" | |
username: "{{ username }}" | |
password: "{{ password }}" | |
validate_certs: "{{ validate_certs }}" |
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
--- | |
nsxt_services: | |
- display_name: HTTPS-Alt | |
nsservice_element: | |
destination_ports: | |
- 8443 | |
l4_protocol: TCP | |
resource_type: L4PortSetNSService | |
state: present | |
nsxt_ip_sets: |
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: 127.0.0.1 | |
connection: local | |
tasks: | |
- name: Create service | |
nsxt_services: | |
hostname: "{{ hostname }}" | |
username: "{{ username }}" | |
password: "{{ password }}" | |
validate_certs: "{{ validate_certs }}" |
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
import ssl, atexit, os, time, sys | |
try: | |
from pyVim import connect | |
except: | |
from pyvim import connect | |
from pyVmomi import vim | |
from getpass import getpass | |
try: | |
vc_fqdn = sys.argv[1] | |
except IndexError: |
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
import requests, json | |
from pprint import pprint | |
from urllib3.exceptions import InsecureRequestWarning | |
requests.packages.urllib3.disable_warnings(category=InsecureRequestWarning) | |
# Setup session object | |
s = requests.Session() | |
s.verify = False | |
# The X-Allow-Overwrite parameter will allow the admin user to update protected objects |
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
#!/bin/bash | |
set -euxo pipefail | |
OM_TOKEN=$1 | |
OM_VERSION=4.4.2 | |
UAA_CLI_VERSION=0.10.0 | |
PKS_VERSION=1.6.1 |
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
#!/bin/bash | |
git show-branch -a \ | |
| grep '\*' \ | |
| grep -v `git rev-parse --abbrev-ref HEAD` \ | |
| head -n1 \ | |
| sed 's/.*\[\(.*\)\].*/\1/' \ | |
| sed 's/[\^~].*//' |
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
# Get machine cert from $HOSTNAME on $PORT | |
echo -n | openssl s_client -connect ${HOSTNAME}:${PORT} 2>/dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' | |
OlderNewer