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
export HOST="scmg-sc2-docker-host" | |
export IP="10.176.144.191" | |
# Condensed from https://docs.docker.com/engine/security/https/#create-a-ca-server-and-client-keys-with-openssl | |
# Run these commands individually | |
openssl genrsa -aes256 -out ca-key.pem 4096 | |
openssl req -new -x509 -days 365 -key ca-key.pem -sha256 -out ca.pem | |
openssl genrsa -out server-key.pem 4096 | |
openssl req -subj "/CN=$HOST" -sha256 -new -key server-key.pem -out server.csr | |
echo subjectAltName = DNS:$HOST,IP:$IP,IP:127.0.0.1 >> extfile.cnf | |
echo extendedKeyUsage = serverAuth >> extfile.cnf |
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
sudo firewall-cmd --state | |
sudo firewall-cmd --permanent --zone=public --add-rich-rule=' | |
rule family="ipv4" | |
source address="[vRealize Appliance IP/Cloud Proxy IP]/32" | |
port protocol="tcp" port="2376" accept' | |
sudo firewall-cmd --permanent --zone=public --add-rich-rule=' | |
rule family="ipv4" | |
source address="[vRealize Appliance IP/Cloud Proxy IP]/32" | |
port protocol="tcp" port="30000-32767" accept' | |
sudo firewall-cmd --permanent --zone=public --add-rich-rule=' |
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
# Condensed from https://docs.docker.com/engine/install/centos/ | |
# Remove old versions | |
sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine | |
# Configure the Docker repository | |
sudo yum install -y yum-utils | |
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo | |
# Install Docker Engine | |
sudo yum install docker-ce docker-ce-cli containerd.io | |
# Start and enable Docker | |
sudo systemctl start docker |
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
function handler($context, $payload) { | |
$oldVMName = $payload.resourceNames[0] | |
$newVMName = $payload.customProperties.userDefinedName | |
$returnObj = [PSCustomObject]@{ | |
resourceNames = $payload.resourceNames | |
} | |
$returnObj.resourceNames[0] = $newVMName |
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
resource "vra_deployment" "this" { | |
name = "Terraform Deployment" | |
description = "Deployed from vRA provider for Terraform." | |
blueprint_id = vra_blueprint.this.id | |
project_id = vra_project.this.id | |
inputs = { | |
Flavor = "small" | |
Image = "ubuntu-bionic" |
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
# Create a new Blueprint | |
resource "vra_blueprint" "this" { | |
name = "Ubuntu Blueprint" | |
description = "Created by vRA terraform provider" | |
project_id = vra_project.this.id | |
content = <<-EOT | |
formatVersion: 1 | |
inputs: | |
Flavor: |
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
provider vra { | |
url = var.vra_url | |
refresh_token = var.vra_refresh_token | |
} | |
# Set up the Cloud Account | |
resource "vra_cloud_account_aws" "this" { | |
name = "AWS Cloud Account" | |
description = "AWS Cloud Account configured by Terraform" | |
access_key = var.aws_access_key |
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
resource "vra_cloud_account_aws" "this" { | |
name = "AWS Cloud Account" | |
description = "AWS Cloud Account configured by Terraform" | |
access_key = var.aws_access_key | |
secret_key = var.aws_secret_key | |
regions = ["us-east-1", "us-west-1"] | |
tags { | |
key = "cloud" | |
value = "aws" |
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
provider vra { | |
url = var.vra_url | |
refresh_token = var.vra_refresh_token | |
} |
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
mkdir -p ~/.terraform.d/plugins | |
wget https://github.com/vmware/terraform-provider-vra/releases/download/v0.1.8/terraform-provider-vra-darwin_amd64-v0.1.8.tgz | |
tar xvf terraform-provider-vra-darwin_amd64-v0.1.8.tgz | |
mv terraform-provider-vra ~/.terraform.d/plugins |
NewerOlder