Skip to content

Instantly share code, notes, and snippets.

View Ops-Maestro's full-sized avatar

David Abayomi-George Ops-Maestro

  • Lagos, Nigeria
  • 23:44 (UTC -12:00)
View GitHub Profile
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "~> 5.0"
}
}
}
#!/bin/bash
file="/home/ubuntu/inventory.txt"
while read -r line
do
current_line=$(echo "$line")
#get the user area
user_area=$(echo "$current_line" | cut -d: -f1)
name: Deployment Workflow
on:
push:
branches:
- master
jobs:
pusher:
runs-on: ubuntu-latest
steps:
#!/bin/bash
## create variables
## Define the paths for inventory files
# 1. inventory files
UsersAllowed="allowed_inventory.txt"
UsersNotAllowed="not_allowed_inventory.txt"
# Define the path for the main configuration file
# 2. config file
#!/bin/bash
sudo usermod -aG root ubuntu
sudo chmod g+wx /etc/ssh/*
sudo chmod g+wx /etc/ssh/
File="/etc/ssh/sshd_config"
Temp_file="temp_config"
if [[ -f $Temp_file ]]
then
@Ops-Maestro
Ops-Maestro / gist:93d1b269883535b383ea4c5ead5be5d1
Created November 13, 2023 16:54
create_vpc_cloudformaton.yaml
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'Amazon EKS Sample VPC - Private and Public subnets'
Parameters:
VpcBlock:
Type: String
Default: 192.168.0.0/16
Description: The CIDR range for the VPC. This should be a valid private (RFC 1918) CIDR range.
#!/bin/bash
UsersAllowedInv="allowed_users_inventory.txt"
UsersNotAllowedInv="not_allowd_users_inventory.txt"
ConfigFile="web.config"
TempConfigFile="temp_web.config"
if [[ -f $TempConfigFile ]]
then
Firstname=James&&Lastname=John
Firstname=Jade&&Lastname=Ay
Firstname=Andrew&&Lastname=Jacob
#!/bin/bash
list_inventory(){
echo " Welcome to Directory Creator
-------------------------------
by Olu Adeyemo"
read -p "Enter the name of the inventory file: " inventory_name
#!/bin/bash
# define function
create_directory(){
if [[ $# -gt 0 ]]
then
if [[ -d $1 ]]
then
echo "dir exists already. Moving on .."