Skip to content

Instantly share code, notes, and snippets.

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:
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
@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
@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 / 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_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.

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 / version_compare.sh
Created May 15, 2018 20:05
All bash version compare
#!/bin/bash
xxx="go1.18.3"
xxx2="go1.10.2"
str_to_array() {
local IFS='.'
local NEW_ARRAY=(0 0 0 0)
local version_part_index=0
for i in $1; do
@michaelgugino
michaelgugino / better.yml
Last active April 11, 2018 18:20
Something better than what I was given.
- hosts: all # Never a good idea to use all group unless testing
sudo: yes # don't do this, use inventory to set the ansible_become=True variable.
tasks:
- name: Cat inputs out of splunk in opt
slurp:
src: "{{ splunk_inputs_file }}"
register: splunk_inputs_file_slurp
when:
- ansible_distribution == 'RedHat'
@michaelgugino
michaelgugino / vars_baby.yml
Created April 4, 2018 16:50
Use the vars!
- name: do x
x:
something: "{{ l_do_x_var }}"
vars:
l_do_x_default: "{{ big_ugly_registered_var.stat.something[1] }}"
l_do_x_var: "{{ my_inventory_var | default(l_do_x_default) }}"