This file contains hidden or 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
| # Show the agents associated with BMH while sorting by the BMH hostnames | |
| $ oc get agent -n $cluster -L agent-install.openshift.io/bmh --sort-by='{.spec.hostname}' | |
| NAME CLUSTER APPROVED ROLE STAGE BMH | |
| 957724de-8d05-4c46-a5f6-4e8584e47c4b cluster true worker Done hosted-worker-0 | |
| dcb102cd-1017-44ed-bccc-567316652c93 cluster true worker Done hosted-worker-1 | |
| 626ef326-522a-4656-b947-1cebb439d002 cluster true worker Done hosted-worker-2 | |
| ae8deb2a-4a4c-4a88-91a2-a16ff37ff756 cluster true worker Done hosted-worker-3 | |
| 08fc64e5-c200-4b30-9a96-1b4b410887f2 cluster true worker Done hosted-worker-5 | |
| # Quick watch in a NS for a HCP cluster provisioned with ZTP: |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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" |
NewerOlder