This example takes olddisk.qcow2
and resizes it into newdisk.qcow2
,
extending one of the guest's partitions to fill the extra space.
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
Host github.com | |
User git | |
Hostname github.com | |
PreferredAuthentications publickey | |
IdentityFile /home/user/.ssh/id_rsa |
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 | |
set -xe | |
curl -OL https://github.com/openshift/openshift-cns-testdrive/raw/ocp4-dev/support/machineset-cli | |
curl -OL https://raw.githubusercontent.com/openshift/openshift-cns-testdrive/ocp4-dev/support/machineset-generator.sh | |
chmod +x machineset-generator.sh | |
chmod +x machineset-cli | |
bash /home/lab-user/machineset-generator.sh 1 infra 0 | oc create -f - | |
export MACHINESET=$(oc get machineset -n openshift-machine-api -l machine.openshift.io/cluster-api-machine-role=infra -o jsonpath='{.items[0].metadata.name}') | |
oc patch machineset $MACHINESET -n openshift-machine-api --type='json' -p='[{"op": "add", "path": "/spec/template/spec/metadata/labels", "value":{"node-role.kubernetes.io/worker":"", "node-role.kubernetes.io/infra":""} }]' |
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
import git,os,shutil | |
def get_branch(url,path,branch): | |
if url == None or path == None: | |
raise ValueError("Please assign right URL and Path") | |
else: | |
if os.path.isdir(path): | |
shutil.rmtree(path) | |
os.mkdir(path) | |
repo = git.Repo.clone_from(url, path, progress=None) |
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
### Create file called machine-config-daemon-force in /run ### | |
ssh [email protected] sudo touch /run/machine-config-daemon-force | |
### Edit node annotations ### | |
oc edit node <node-name> | |
### Check Annotations, change like below sample ### | |
machineconfiguration.openshift.io/currentConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
machineconfiguration.openshift.io/desiredConfig: rendered-worker-ab4a1e7216bf3da2a5203f09c871b456 | |
machineconfiguration.openshift.io/reason: "" |
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
# The goal: create a list of maps of subnet mappings so we don't have to statically hard-code them in aws_lb | |
# https://www.terraform.io/docs/providers/aws/r/lb.html#subnet_mapping | |
locals { | |
# These represent dynamic data we fetch from somewhere, such as subnet IDs and EIPs from a VPC module | |
subnet_ids = ["subnet-1", "subnet-2", "subnet-3"] | |
eips = ["eip-1", "eip-2", "eip-3"] | |
} | |
# Here's the hack! The null_resource has a map called triggers that we can set to arbitrary values. | |
# We can also use count to create a list of null_resources. By accessing the triggers map inside of |
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
# This gist mimics the supposed behavior of | |
# variable = merge(someListOfMaps[*].parameters...) | |
# or | |
# policy_parameters = merge(data.azurerm_policy_definition.d_policy_definitions[*].parameters...) | |
locals { | |
policy_parameters = [ | |
for key,value in data.azurerm_policy_definition.d_policy_definitions: | |
{ | |
parameters = jsondecode(value.parameters) |
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: v1 | |
kind: List | |
items: | |
- apiVersion: batch/v1beta1 | |
kind: CronJob | |
metadata: | |
name: pr-cleanup | |
namespace: ghe | |
spec: | |
concurrencyPolicy: Replace |
NewerOlder