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
// Cleanup all Kubernetes tables that are orphaned with no cluster | |
// Define the tables where records need to be deleted | |
// MUST BE RUN IN A FIX SCRIPT IN DISCOVERY AND SERVICE MAPPING SCOPE | |
var k8scluster_sysid = '9c880487475c0a10971497da116d43d1'; //sys_id of cluster | |
var tables = [ | |
'cmdb_ci_kubernetes_cluster', | |
'cmdb_ci_kubernetes_service', | |
'cmdb_ci_kubernetes_replicationcontroller', | |
'cmdb_ci_kubernetes_replicaset', | |
'cmdb_ci_kubernetes_daemonset', |
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
#This will install the ArgoCD manifest, and add and ingress for traefik so you can access it on http://hostname/argocd | |
kubectl create namespace argocd | |
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml | |
kubectl apply -f - << "EOF" | |
--- | |
#Need to configure argocd to server.insecure: "true" | |
#https://argo-cd.readthedocs.io/en/stable/operator-manual/ingress/#traefik-v22 | |
apiVersion: v1 | |
kind: ConfigMap |
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
kubectl create -f - <<EOF | |
--- | |
kind: Namespace | |
apiVersion: v1 | |
metadata: | |
name: portainer | |
labels: | |
name: portainer | |
--- | |
apiVersion: apps/v1 |
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
kubectl create -f - <<EOF | |
--- | |
apiVersion: v1 | |
kind: Namespace | |
metadata: | |
name: nginxweb | |
labels: | |
name: nginx | |
--- | |
apiVersion: apps/v1 |
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
/* | |
Borrowing from https://servicenowguru.com/system-definition/find-references-specific-record/ | |
This background script finds all references to an existing record, e.g., a company, or group | |
and exports them to a CSV saved in the sys_data_source table. | |
*/ | |
var table = 'core_company'; | |
var rec_sys_id = '0e8b8e650a0a0b3b004f285ffbb1a4fc'; | |
var references = findReferencesToCoreRecord(table, rec_sys_id); |
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
access_key = "SampleAccesKeyAKIA5HQPIDLAFRCZVQ88" | |
secret_key = "SamplePrivateKeylmy+asdfasdsdfaa3424g32gfasdfaS" |
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
variable "access_key" { | |
description = "Access key to AWS console" | |
} | |
variable "secret_key" { | |
description = "Secret key to AWS console" | |
} | |
variable "instance_name" { | |
description = "Name of the instance to be created" |
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 "aws" { | |
access_key = "${var.access_key}" | |
secret_key = "${var.secret_key}" | |
region = "us-west-2" | |
} | |
resource "aws_instance" "ec2_instance" { | |
ami = "${var.ami_id}" | |
instance_type = "${var.instance_type}" | |
key_name = "${var.ami_key_pair_name}" |
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
│ Error: Missing required argument | |
│ | |
│ with vsphere_virtual_machine.vm, | |
│ on instance.tf line 95, in resource "vsphere_virtual_machine" "vm": | |
│ 95: windows_options { | |
│ | |
│ "clone.0.customize.0.windows_options.0.domain_admin_password": all of | |
│ `clone.0.customize.0.windows_options.0.domain_admin_password,clone.0.customize.0.windows_options.join_domain` | |
│ must be specified |
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
<# | |
Since ServiceNow will only allow 10,000 records to be exported by default we need to use pagingation for large exports. | |
This script will query the table api for the selected table and loop through blocks of 10,000 until all records are retrived. | |
It then converts the JSON payload to a CSV | |
#> | |
# Set ServiceNow credentials | |
$username = "admin" | |
$password = "pass" | |
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force |
NewerOlder