requires bash v4+, netcat (nc), jq, spruce
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
#@ load("@ytt:data", "data") | |
all: | |
hosts: #@ data.values | |
vars: | |
ansible_connection: local |
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
#@ load("@ytt:data", "data") | |
#@ load("@ytt:template", "template") | |
#@ def parse(deployment): | |
#@ key = "{}".format(deployment.ip) | |
#@ return {key: {"idrac_ip": "{{ inventory_hostname }}","catalog_xml": deployment.catalogXml}} | |
#@ end | |
all: | |
hosts: |
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
#!/bin/bash | |
# STEP 1: Mount bootable USB and clean up disks | |
# IMPORTANT: Catalina now introduces a different approach to Disks/Volumes: https://eclecticlight.co/2019/12/17/how-clean-re-installs-change-in-catalina/ | |
# Erase everything for a proper clean install and then create a new GUID Partition Apple_APFS volume (equivalent to https://www.youtube.com/watch?v=PqfqcwmHowc&ab_channel=AjudaAqui) | |
# Can all be done through Disk Utility rather than terminal diskutil. You just need to create at least one volume otherwise the installer will not see the disk | |
# STEP 2: Install Catalina from bootable USB | |
# STEP 3: Download this gist from UI of GitHub "Download Zip |
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 bash | |
set -ue | |
export urls=( \ | |
# BOSH release download | |
https://bosh.io \ | |
# PCF API with metadata for upgrades | |
https://network.pivotal.io \ | |
# PCF-Pipelines open-source updates |
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
TMPDIR=""¬ | |
TMPDIR=$(mktemp -d -t dynamic_inventory.XXXXXX) | |
trap 'rm -rf ${TMPDIR}' INT TERM QUIT EXIT | |
INVENTORY_FILE="${TMPDIR}"/inventory.yml | |
cat <<EOF > "${INVENTORY_FILE}" | |
all: | |
hosts: | |
${IP_ADDRESS}: | |
ansible_python_interpreter: /usr/bin/python3 |
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
# Custom certs (taht were installed on Ubuntu) being recognised by python. For example ansible-galaxy | |
export REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt | |
# Or also could do | |
# $ sudo update-ca-certificates --fresh | |
# $ export SSL_CERT_DIR=/etc/ssl/certs |
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
govc pool.info -json /drinks-dc/host/drinks-cl/Resources/chardonnay | jq -r '.ResourcePools[].Vm[] | join(":")' | xargs govc ls -L | |
# relative path - not guaranteed to be unique | |
govc pool.info ${GOVC_RESOURCE_POOL} | |
# absolute path | |
govc pool.info /${GOVC_DATACENTER}/host/${GOVC_CLUSTER}/Resources/${GOVC_RESOURCE_POOL} | |
# relative path | |
govc datastore.info "${GOVC_DATASTORE}" |
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
jobs: | |
- name: upload-product | |
plan: | |
- aggregate: | |
- do: | |
- get: pcf-pipelines-tarball | |
- task: unpack-tarball | |
config: | |
platform: linux | |
image_resource: |
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
# from: https://github.com/stedolan/jq/issues/2154#issuecomment-653981166 | |
# alternative to Gron | |
jq -r 'paths as $p | "\($p) = \(getpath($p))"' |
NewerOlder