Skip to content

Instantly share code, notes, and snippets.

@dmc5179
dmc5179 / docker-ce-rhel8.sh
Last active March 20, 2021 16:55
Docker CE on RHEL 8 with IPTables
#!/bin/bash
# Add Docker CE Repo
sudo dnf config-manager --add-repo=https://download.docker.com/linux/centos/docker-ce.repo
# Configure Docker CE Repo
sudo sed -i '/^gpgkey=https:\/\/download.docker.com\/linux\/centos\/gpg/a module_hotfixes=True' /etc/yum.repos.d/docker-ce.repo
# Install Docker CE
sudo dnf install -y docker-ce
@dmc5179
dmc5179 / galaxy-podman.sh
Last active March 25, 2020 17:49
Script to run Ansible Galaxy with podman like docker-compose
#!/bin/bash -xe
# Script to run Ansible Galaxy with podman like docker-compose
#GALAXY_NET="galaxy-net"
#SINGLE_POD="false"
SUDO=""
#if [[ `whoami` == root ]]
#!/usr/bin/env bash
if [[ "$(whoami)" != "root" ]]
then
echo
echo "*** MUST BE root TO RUN THIS SCRIPT ***"
echo
exit 1
fi
@dmc5179
dmc5179 / hosts
Created February 20, 2020 20:24
GeoAxis Integration in OCP 3
# Authentication via GEOAxIS, RH SSO, & htpasswd
openshift_master_identity_providers=[{'name':'GEOAxIS', 'login':'true', 'challenge':'false', 'mappingMethod':'add', 'kind':'OpenIDIdentityProvider', 'client_id':'openshift', 'client_secret':'${OCP_SSO_CLIENT_SECRET:=}', 'urls':{'authorize':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/auth?kc_idp_hint=${OCP_SSO_GEOAXIS_IDENTITY_PROVIDER_ALIAS:=GEOAxIS}', 'token':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/token', 'userInfo':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/userinfo'}, 'claims':{'id':['sub'], 'preferredUsername':['preferred_username'], 'name':['name'], 'email':['email']}}, {'name':'RHSSO', 'login':'true', 'challenge':'false', 'mappingMethod':'add', 'kind':'OpenIDIdentityProvider', 'client_id':'openshift', 'client_secret':'${OCP_SSO_CLIENT_SECRET:=}', 'urls':{'authorize':'https://${OCP_SSO_HOST}/auth/realms/OpenShift/protocol/openid-connect/auth', 'token':'https://${OCP_S
@dmc5179
dmc5179 / banner.js
Created January 28, 2020 03:00
IPA Warning Banner
/* Authors:
* Petr Vobornik <pvoborni@redhat.com>
* Dan Clark <danclark@redhat.com>
*
* Copyright (C) 2014 Red Hat
* Copyright (C) 2019 Red Hat
* see file 'COPYING' for use and warranty information
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@dmc5179
dmc5179 / route53_dns_update.sh
Last active January 13, 2020 14:12
AWS Update Route53 DNS Record
#!/bin/bash
#
# Script to change the Route53 public DNS entry associated to this host
# with the new EIP assigned to this host when booted.
#
# Need to get EIP using the CLI since that IP is not actually assigned to the host
set -xe
INSTANCE_ID=""
HOSTED_ZONE=""
#!/bin/bash
# DMC: Create Ignition files for each node based on the base ignition file and the fake root for each host
# This script is a work in progress
# Things that we have learned so far....
# the bootstrap node I can set the network with the fake root ifcfg-ens3
# that has failed every time for the masters even though m4.2xlarge is ens3
# I've had to use the VPC DHCP option set
@dmc5179
dmc5179 / openshift4-nightly-mirror.sh
Created December 27, 2019 16:51
Mirror OpenShift 4 Nightly Release
export OCP_RELEASE='4.3.0-0.nightly-2019-12-24-120035'
export LOCAL_REGISTRY='openshift4-registry.redhatgovsa.io:5000'
export LOCAL_REPOSITORY='ocp4/openshift4'
export PRODUCT_REPO='openshift-release-dev'
export LOCAL_SECRET_JSON='/home/ec2-user/pull-secret.txt'
export RELEASE_NAME="ocp-release-nightly"
oc adm -a ${LOCAL_SECRET_JSON} release mirror \
--from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE} \
@dmc5179
dmc5179 / openshift4-mirror.sh
Created December 27, 2019 16:48
Mirror an OpenShift 4 GA Repository
export OCP_RELEASE=4.2.12
export LOCAL_REGISTRY='openshift4-registry.redhatgovsa.io:5000'
export LOCAL_REPOSITORY='ocp4/openshift4'
export PRODUCT_REPO='openshift-release-dev'
export LOCAL_SECRET_JSON='/home/ec2-user/pull-secret.txt'
export RELEASE_NAME="ocp-release"
oc adm -a ${LOCAL_SECRET_JSON} release mirror \
--from=quay.io/${PRODUCT_REPO}/${RELEASE_NAME}:${OCP_RELEASE} \
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: rstudio-pv-claim
labels:
app: rstudio
spec:
accessModes:
- ReadWriteOnce