Skip to content

Instantly share code, notes, and snippets.

View devops-rob's full-sized avatar
🏠
Working from home

DevOps Rob devops-rob

🏠
Working from home
View GitHub Profile
@devops-rob
devops-rob / Test_Environment_deploy_README.txt
Last active July 5, 2017 14:28
Deploy Active Directory Environment with users and groups in PowerShell
In order to run this script, you will need to create an EnvironmentDeployment Folder in the root of the C:\ on the target server and place these two files in that folder. This folder contains two files, firstly, a .csv file which contains the user accounts that will be injected into the Active Directory database and the script itself.
Let’s get started - The script is a function based script which lets you select which stage of the deployment you would like to undertake.
• Open the script called test_environment_deploy.ps1 from the c:\EnvironmentDeploy folder.
• Press the run button (This is the play button at the top of the screen)
• You will be presented with a pop-up box asking you which action you would like to perform. Select the action you require and click the OK button.
• Sit back and let the script do its magic. Repeat these steps for every function you would like to perform
@devops-rob
devops-rob / jenkins2git_backup.sh
Last active December 4, 2017 20:46
Script to backup Jenkins Configurations to git
#!/bin/bash
#Jenkins backup script by DevOpsRob
#This script requires a git repo called jenkins_backup to be created
#You will need to add your ssh public key to the deploy keys of this newly created repo and allow read/write permissions
#Clone the repo into /var/lib/ folder
#Save this script to the /root/ folder
#Setup a crontab to run this script as per your requirement
#install git command line tools
yum install git -y

Keybase proof

I hereby claim:

  • I am robertraybarnes on github.
  • I am robertraybarnes (https://keybase.io/robertraybarnes) on keybase.
  • I have a public key ASBV_3_9BWRL3j082We3CfqAx9cpuH07mIFOpOUpZCx4rQo

To claim this, I am signing this object:

@devops-rob
devops-rob / terraform.gitignore
Created July 11, 2019 17:40
.gitignore file for tearraform projects
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log

What needs to be investigated?

A brief description of what needs to be ascertained / learned through this spike.

Example: Investigate why the provisioning scripts are failing

Scope

Example: options to resolve this issue in all environments

@devops-rob
devops-rob / Consul-backend-azure-unseal.hcl
Last active July 19, 2019 12:58
Simple Vault config for consul backend and auto-unsealing using azure key vault
listener "tcp" {
address = "0.0.0.0:8200"
tls_disable = 1 # TLS will need to be enabled for production
tls_min_version = "tls12"
}
storage "consul" {
address = "consul:8500"
path = "vault"
service = "vault"
scheme = "http"
@devops-rob
devops-rob / azure-secrets-engine-config.sh
Created July 24, 2019 10:44
Enable and configure azure secrets backend for gashicorp vault
#!/bin/sh
##
export AZURE_SUBSCRIPTION_ID=
export AZURE_TENANT_ID=
export AZURE_CLIENT_ID=
export AZURE_CLIENT_SECRET=
export ROLE_NAME=spike
##
vault secrets enable azure
@devops-rob
devops-rob / custom-azure-role-for-vault.sh
Created July 24, 2019 10:56
Create an open custom role for hashicorp vault to consume
#!/bin/bash
export SUBSCRIPTION_ID=
az role definition create --role-definition=<<EOF
{
"Name": "vault-admin",
"IsCustom": true,
"Description": "role for vault to create service principals.",
#!/bin/bash
function packagereqchecker {
declare -a packages=("wget" "setroubleshoot-server" "selinux-policy-devel" "unzip")
for app in "${packages[@]}";
do
echo $app
if yum list installed $app 2>&1 > /dev/null;
then

Keybase proof

I hereby claim:

  • I am devops-rob on github.

  • I am devopsrob (https://keybase.io/devopsrob) on keybase.

  • I have a public key ASBbGv8RQlAmaJ8xIoDtjNtcxKgdCvQuozoR11XAU5jZ_Qo