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
--- | |
- name: Test date handling for machine reservation re-up | |
hosts: localhost | |
tasks: | |
- name: Get tomorrow's date | |
ansible.builtin.command: date -d "tomorrow" "+%Y-%m-%d" | |
register: tomorrow | |
changed_when: false | |
- name: Set start date | |
ansible.builtin.set_fact: |
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
#!/bin/bash | |
for pod in $(oc -n openshift-storage get pod -l app=rook-ceph-osd-prepare -o name) | |
do | |
DISK=$(oc -n openshift-storage get $pod -oyaml | grep -A1 ROOK_DATA_DEVICES | awk -F'"' '/value/ {print $4}') | |
oc -n openshift-storage debug $pod -- bash -c "sgdisk --zap-all $DISK; dd if=/dev/zero of=$DISK bs=1M count=100 oflag=direct,dsync" | |
done |
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
#!/bin/bash | |
# Try to clean everything created by kubevirt | |
KC=kubectl | |
# Take out anything added by KubeVirt that lives in a namespace | |
NSRES=$($KC api-resources --namespaced=true | awk '/kubevirt.io/ {print $1}'| tr -s ' ' ',') | |
$KC delete $res --all-namespaces --all --now=true --wait=false | |
# Take out any cluster-wide KubeVirt resources |
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
#!/usr/bin/env python | |
import sys | |
# turn IP address string into array of int | |
def parseip(ipstr): | |
array = ipstr.split('.') | |
return [int(x) for x in array] | |
# append last 3 of IP to static MAC vendor ID and return printable string | |
def ip2mac(ip): |
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
#!/bin/bash | |
COUNT=${1:-17} | |
NAME=rh8- | |
for num in $(seq 1 $COUNT) | |
do | |
oc process openshift//rhel8-desktop-small NAME=${NAME}${num} > /tmp/${NAME}${num}.yaml | |
done |
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
#!/bin/bash | |
BACKEND=${1:-trident-backend.json} | |
source <(awk -F':' '$2~/./ { gsub(/[ \t,"]+/,""); print $1 "=\"" $2 "\""}' $BACKEND) | |
PREFIX=$(echo $storagePrefix |tr - _) | |
echo $PREFIX | |
for lun in $(showmount -e $dataLIF | awk -F '[/ ]' "/$PREFIX/ { print \$2 }") | |
do | |
SSHPASS=${password} sshpass -e ssh -l $username $managementLIF volume offline -f $lun |
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
#!/bin/bash | |
TARGETDIR=~/bin | |
VERSION=latest-4.8 | |
URL="https://mirror.openshift.com/pub/openshift-v4/clients/ocp-dev-preview/${VERSION}" | |
pullsecret_file=~/openshift_pull.json | |
update_tool () { | |
TOOL=${1:-openshift-install} | |
curl -sLO ${URL}/${TOOL}-linux.tar.gz | |
tar xf ${TOOL}-linux.tar.gz |
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
oc get nns -o jsonpath='{range .items[*]}{@.metadata.name}{"\t"}{@.status.currentState.interfaces[?(@.name=="eno4")].ipv4}{"\n"}' |
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
--- | |
apiVersion: hostpathprovisioner.kubevirt.io/v1beta1 | |
kind: HostPathProvisioner | |
metadata: | |
name: hostpath-provisioner | |
namespace: openshift-cnv | |
spec: | |
imagePullPolicy: IfNotPresent | |
pathConfig: | |
path: "/var/hostpath" |
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
--- | |
apiVersion: machineconfiguration.openshift.io/v1 | |
kind: MachineConfig | |
metadata: | |
name: 50-set-selinux-for-hostpath-provisioner | |
labels: | |
machineconfiguration.openshift.io/role: worker | |
spec: | |
config: | |
ignition: |
NewerOlder