Skip to content

Instantly share code, notes, and snippets.

import os
import sys
import pytest
try:
# python3, mock is built in.
from unittest.mock import patch
except ImportError:
# In python2, mock is installed via pip.
@michaelgugino
michaelgugino / example_bot_info.md
Created August 27, 2018 21:40
example_bot_info.md

Your test failed, now what?

Yo, here's some info about who owns what tests: gcp-e2e: file against openshift/origin

Other heading

Here's some instructions about linking to flakey tests in the repos I just mentioned.

@michaelgugino
michaelgugino / fedora-inv.txt
Created August 30, 2018 20:15
Openshift 3.10 + Fedora
[somegroup]
localhost
[somegroup:vars]
ansible_connection=local
[OSEv3:children]
masters
nodes
etcd
@michaelgugino
michaelgugino / example.yml
Created September 5, 2018 18:00
How to use variable group_names.
# prerequisites.yml
- hosts: "{{ new_hosts | default('apache_hosts') }}"
tasks:
- do_something
# playbook1.yml
- hosts: "{{ current_apache_hosts | default('apache_hosts') }}"
tasks:
- do_something
@michaelgugino
michaelgugino / example.yml
Created September 5, 2018 18:04
Groups and such.
#inventory.txt
[apache_hosts]
node1
node2
[new_group]
node2
# playbook1.yml
- hosts: apache_hosts
FROM fedora:28
RUN \
dnf install -y dnf-plugins-core git gcc-c++ python2 && \
dnf copr -y enable vbatts/bazel && \
dnf install -y bazel && \
dnf clean all
admin:
email: mgugino@redhat.com
password: <some password>
sshKey: "ssh-rsa pubkey"
# this will be your libvirt dns domain, ensure you configure it to be unique.
baseDomain: tt.testing
libvirt:
#!/bin/bash
rm -f /var/lib/libvirt/images/*.ign
rm -f /var/lib/libvirt/images/coreos_base
rm -f /var/lib/libvirt/images/master0
rm -f /var/lib/libvirt/images/bootstrap
virsh undefine bootstrap
virsh undefine master0
virsh net-destroy tectonic
virsh net-undefine tectonic
Bazel:
I couldn't get the pod provided to actually work, so I built my own:
https://gist.github.com/michaelgugino/257519b9e2c3804c8b291a13726e6a9e
In hind sight, the pod provided might actually work, given the following:
Before attempting to run docker/podman command, ensure you mkdir .cache/ and
chmod 777, otherwise pod won't be able to write in that directory and things
break.
@michaelgugino
michaelgugino / cluster-config.yaml
Last active October 2, 2018 20:30
Compare input and output
apiVersion: v1
data:
install-config: |
admin:
email: myemail@myhost.com
password: somesupergoodpasswordgoeshere
sshKey: |
ssh-rsa < public key>
baseDomain: tt2.testing
clusterID: c3b78518-d102-4b64-b84f-c9e2fd34480a