Skip to content

Instantly share code, notes, and snippets.

View InputObject2's full-sized avatar

InputObject2

  • Montreal, Canada
  • 13:23 (UTC -05:00)
View GitHub Profile
@InputObject2
InputObject2 / secret.yaml
Last active July 31, 2021 17:00
Deploy something that allows accessing the idrac console of an older Dell (R*10) using VNC
---
apiVersion: v1
kind: Secret
metadata:
name: idrac-secrets
type: Opaque
data:
ROOT_PASSWORD: eW91cnBhc3N3b3Jk
<#
Create Unix VM's.
PREREQUISITES:
- A VM that has been installed with an OS that supports cloud-init
- cloud-init is installed on the vm
How it works:
- Asks for a bunch of parameters
- Creates a disk from parent vhdx for speed
<#
Create a Unix VM.
1- We grab the current VM's that are named "ntprsrv-app##"
2- We get the number+1, that's the new name.
3- We create the folders under D:\VM\VMname\Virtual Hard Disks
4- We copy the "D:\Software\CentOS 7 - Ready to Copy - 2018-01-20.vhdx" to it.
5- We create a new VM using the disk, there's a prompt for the number of CPU and RAM.
6- We disable SecureBoot
7- We boot that bad boy up.
Param(
[Parameter(Mandatory=$false)][switch]$shutdown=$false,
[Parameter(Mandatory=$false)][switch]$vm=$false
)
# Powershell refuses to connect to the Netbox API on our setup without this.
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
# Powershell refuses to connect to the Netbox API on our setup without this.
add-type @"
using System.Net;
using System.Security.Cryptography.X509Certificates;
public class TrustAllCertsPolicy : ICertificatePolicy {
public bool CheckValidationResult(
ServicePoint srvPoint, X509Certificate certificate,
WebRequest request, int certificateProblem) {
return true;
}