Skip to content

Instantly share code, notes, and snippets.

View chrigl's full-sized avatar
🇺🇦

Christoph Glaubitz chrigl

🇺🇦
View GitHub Profile
@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 / 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 / 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 / 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 / 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"
heat_template_version: 2015-04-30
resources:
network:
type: OS::Neutron::Net
properties:
name: ceph_dev_net
[DEFAULT]
[oslo_concurrency]
lock_path = /var/lib/tempest/run_lock
[auth]
test_accounts_file = /etc/tempest/accounts.yaml
use_dynamic_credentials = false
[identity]
@chrigl
chrigl / check_duplicate_fips.py
Last active July 19, 2016 12:13
Detect duplicate floating ips in midonet zookeeper
#!/usr/bin/env python
from __future__ import print_function
from kazoo.client import KazooClient
from collections import Counter
# id of ext-net
DEFAULT_BRIDGE='caf8de33-1059-4473-a2c1-2a62d12294fa'
@chrigl
chrigl / gist:57f898f4e8df4fcf9c15
Created June 10, 2015 15:12
Provisioning of a floating ip network in OpenContrail
#!/usr/bin/env python
#
# Copyright 2015 [email protected]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@chrigl
chrigl / upstartwatch.py
Created May 6, 2015 08:09
upstartwatch... not sure if this is a good idea.
#!/usr/bin/env python3
import sys
import dbus
import time
import json
import argparse
import threading
import functools
import http.server
from gi.repository import GObject