Skip to content

Instantly share code, notes, and snippets.

View liveaverage's full-sized avatar
⚙️

J.R. Morgan liveaverage

⚙️
View GitHub Profile
---
- name: Windows PowerSTIG
hosts: all
vars:
ansible_connection: winrm
ansible_winrm_transport: basic
gather_facts: no
become: yes
become_method: runas
become_user: Administrator
@liveaverage
liveaverage / OCP4.2 on OSP13
Last active March 26, 2020 12:49
Quick steps for lab provisioning of OCP4.2 on OSP13
source overcloudrc
openstack network create --provider-network-type flat --provider-physical-network datacentre public --external --share
openstack subnet create --no-dhcp --gateway 172.16.0.1 --subnet-range 172.16.0.0/24 --allocation-pool start=172.16.0.50,end=172.16.0.90 --network public public_subnet
openstack floating ip create --floating-ip-address 172.16.0.70 public
openstack flavor create --ram 16384 --disk 20 --vcpu 8 --public m1.xlarge
openstack flavor create --ram 10240 --disk 20 --vcpu 4 --public m1.large
curl --compressed --insecure https://192.168.122.2/rhcos-42.80.20190725.1-openstack.qcow2 -O
openstack image create rhcos --container-format bare --disk-format qcow2 --public --file rhcos-*.qcow2
openstack project create openshift
openstack quota set --ram -1 --cores -1 openshift
@liveaverage
liveaverage / rhcos.json
Created April 27, 2020 17:36
Packer+OCP 4 vSphere UPI
{
"variables": {
"vcenter_server": "vcenter.gxr.me",
"vcenter_username": "[email protected]",
"vcenter_password": "",
"vcenter_datacenter": "GXR",
"vcenter_cluster": "GXR-Primary",
"vcenter_host": "esx2.gxr.me",
"vcenter_datastore_vm": "esx2_vms_nvme1",
@liveaverage
liveaverage / remove_gitlab_artifacts.sh
Created April 28, 2020 19:33 — forked from carceneaux/remove_gitlab_artifacts.sh
Script for removing GitLab Job Artifacts.
#!/bin/bash
#
# Written by Chris Arceneaux
# GitHub: https://github.com/carceneaux
# Email: [email protected]
# Website: http://arsano.ninja
#
# Note: This code is a stop-gap to erase Job Artifacts for a project. I HIGHLY recommend you leverage
# "artifacts:expire_in" in your .gitlab-ci.yml
#
@liveaverage
liveaverage / playbyplay.sh
Last active June 25, 2020 01:15
OCP 4.5 vSphere IPI Install
# Grab your vSphere cert and ensure it's trusted
openssl s_client -connect vcsa.gxr.me:443 -showcerts
# Copy BEGIN/END Certificate contenst to /etc/pki/tls/certs/vsphere.pem
# Prior to OpenShift cluster install, identify base domain and cluster name, reserve (2) IPs and create (2) DNS A records:
# - 192.168.20.99 (api.gnv.int.shifti.us)
# - 192.168.20.98 (*.apps.gnv.int.shifti.us)
@liveaverage
liveaverage / create_ocp_project.yaml
Created June 30, 2020 20:10
OCP 4 Project Provisioning and Quota Assignment
- name: Create OpenShift Resources
hosts: localhost
connection: local
vars:
oc_master: lab.gxr.me
requestor: jrmorgan
useremail: [email protected]
project: sample
initjenkins: no
quota: silver
@liveaverage
liveaverage / README.md
Last active October 8, 2020 19:09
GitLab CI/CD Pipeline

GitLab CI/CD Pipeline Configuration

Save the following contents to .gitlab-ci.yml within your new or existing Ansible role project/repository:

image: python:3-slim

before_script:
  - pip install ansible-lint
 - ansible-lint --version
---
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: ingressroutes.traefik.containo.us
spec:
group: traefik.containo.us
version: v1alpha1
names:
@liveaverage
liveaverage / memusage.sh
Created June 24, 2021 19:02
Memory Usage
#!/bin/bash
ps -eo size,pid,user,command --sort -size | \
awk '{ hr=$1/1024 ; printf("%13.2f Mb ",hr) } { for ( x=4 ; x<=NF ; x++ ) { printf("%s ",$x) } print "" }' |\
cut -d "" -f2 | cut -d "-" -f1
@liveaverage
liveaverage / sno-storage-cluster.yaml
Created November 12, 2021 18:41
Single Node Storage Cluster (Unsupported; Testing only)
apiVersion: ocs.openshift.io/v1
kind: StorageCluster
metadata:
name: ocs-storagecluster
namespace: openshift-storage
spec:
encryption: {}
externalStorage: {}
managedResources:
cephBlockPools: {}