Skip to content

Instantly share code, notes, and snippets.

View chrigl's full-sized avatar
🇺🇦

Christoph Glaubitz chrigl

🇺🇦
View GitHub Profile
@chrigl
chrigl / json
Created February 22, 2018 21:06
netbox-swagger.json
{
"swagger": "2.0",
"info": {
"title": "NetBox API",
"description": "",
"version": ""
},
"host": "netbox-dev.mgmt.innovo-cloud.de",
"schemes": [
"https"
@chrigl
chrigl / sync_file.yml
Created June 14, 2018 13:41
Program in a language that is not a programming language.
---
# NOTE: This should be a role (or custom module), but currently include_role is too buggy to use
- name: "sync_file | Set facts for directory and file when sync_file_path is defined"
set_fact:
sync_file_dir: "{{ sync_file_path | dirname }}"
sync_file: "{{ sync_file_path | basename }}"
when: sync_file_path is defined and sync_file_path != ''
- name: "sync_file | Set fact for sync_file_path when undefined"
@chrigl
chrigl / console out
Last active June 14, 2018 14:24
Well, ansible 2.5 behaves differently than 2.4 at some places.
> ansible-playbook --version
ansible-playbook 2.5.1
> ansible-playbook blah.yml
PLAY [local testing] *******************************************************************************************************************************************************************************************************************************************************************************************************************************************************
TASK [test set_fact] *******************************************************************************************************************************************************************************************************************************************************************************************************************************************************
ok: [localhost] => (item={u'path': u'/etc/kubernetes/ssl/apiserver.pem', u'no_srcs': True, u'sync_unneeded': False})
ok: [localhost] => (item={u'path': u'/etc/kubernetes/ssl/kube-scheduler.pem', u'no_srcs': True
@chrigl
chrigl / inventory.go
Created August 13, 2018 12:52
There is some code on my computer, I wrote but not remember why.
package main
import (
"encoding/json"
"fmt"
"io/ioutil"
"log"
"os/exec"
"path"
@chrigl
chrigl / gist:754096d869ee84759bffd658a8cef4f3
Last active November 28, 2018 18:23
Add spec to ProviderSpec
type OpenstackClusterProviderSpec struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`
Spec ClusterSpec `json:"spec,omitempty"`
}
type ClusterSpec struct {
// NodeCIDR is the OpenStack Subnet to be created
NodeCIDR string `json:"nodeCidr,omitempty"`
@chrigl
chrigl / unstructured.go
Created February 22, 2019 14:55
Use Kubernetes client-go with unstructured and dynamic client
package main
import (
"flag"
"fmt"
"log"
"os"
"os/user"
"path/filepath"
@chrigl
chrigl / gophercloud-server-addresses.go
Last active July 14, 2019 18:53
gophercloud: extracting addresses of servers
package main
import (
"fmt"
"log"
"github.com/gophercloud/gophercloud"
"github.com/gophercloud/gophercloud/openstack"
"github.com/gophercloud/gophercloud/openstack/compute/v2/servers"
"github.com/gophercloud/utils/openstack/clientconfig"
@chrigl
chrigl / okd-console.yaml
Created July 14, 2020 13:41
Basic deployment of openshift origon console. DON'T use this!
apiVersion: v1
kind: ServiceAccount
metadata:
name: oc-admin
namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: oc-admin
@chrigl
chrigl / debug-ds.yaml
Last active May 18, 2022 11:55
removed namespace
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
app: debugging
name: debugging
spec:
revisionHistoryLimit: 2
selector:
matchLabels:
@chrigl
chrigl / rook-shutdown.sh
Last active January 18, 2021 11:13
shutdown rook
#!/bin/bash
# This script shuts down a rook-ceph cluster
# Please DON'T use this. It is only for demonstration purposes.
set -eux -o pipefail
force=false
while getopts "f" arg; do
case $arg in
f)
force=true