Skip to content

Instantly share code, notes, and snippets.

View pixie79's full-sized avatar

Mark Olliver pixie79

  • UK
  • 11:09 (UTC +01:00)
View GitHub Profile
@pixie79
pixie79 / cloud-config
Created March 6, 2015 14:54
docker cloud-config - override storage to brtfs
coreos:
units:
- name: docker.service
command: start
content: |
[Unit]
Description=Docker Application Container Engine
Documentation=http://docs.docker.com
After=docker.socket early-docker.target network.target
Requires=docker.socket early-docker.target

Installing Centos using DHCP, TFTP and Kickstart Files.

We want to deploy physical nodes before cluster installation, in order to speed up the deployment, we'd like to automate most of the process, requiring us only to enter hostnames and IP address. we will need:

  • A DHCP Server
  • TFTP Server
  • HTTP Server
  • Centos ISO file
  • Optionally: local repo server, local dns server, local ntp server.
@pixie79
pixie79 / docker_patch
Last active August 29, 2015 14:03
Ansible Docker patch to allow for authenticated pull
diff --git a/library/cloud/docker b/library/cloud/docker
index 79c6145..c77bb46 100644
--- a/library/cloud/docker
+++ b/library/cloud/docker
@@ -557,7 +557,7 @@ class DockerManager:
'detach': self.module.params.get('detach'),
'name': self.module.params.get('name'),
'stdin_open': self.module.params.get('stdin_open'),
- 'tty': self.module.params.get('tty'),
+ 'tty': self.module.params.get('tty')
# -*- coding: utf-8 -*-
# -*- mode: python -*-
DOCUMENTATION = '''
---
module: gce_meta
short_description: Google Compute Engine Meta Service Lookup.
description:
- The service returns meta information found from the Google Meta service
about the GCE Instance on which it is running for the meta key given.
@pixie79
pixie79 / consul
Created July 7, 2014 06:06
Consul Service module for Ansible
# -*- coding: utf-8 -*-
# -*- mode: python -*-
DOCUMENTATION = '''
---
module: consul
short_description: Consul Agent API interaction with Docker
description:
- This module wraps the Consul API making calls to the Agent end points
to register and unregister services.
- name: Create instances
hosts: localhost
tasks:
- name: Launch instances
local_action: gce instance_names=dcom-1-rc
machine_type=n1-highcpu-2
image=backports-debian-7-wheezy
zone=europe-west1-b
metadata='{"dc":"eu"}'
project_id=XXX
@pixie79
pixie79 / gce_meta
Created July 1, 2014 20:00
gce_meta module
#!/usr/bin/env python
import urllib2
import sys
import json
import shlex
import os
def get_meta(module):
metadata = module.params.get('gcemeta').split(",")
url = "http://metadata.google.internal/computeMetadata/v1/instance/attributes/"
@pixie79
pixie79 / make_hash
Created June 2, 2014 20:01
ruby to hash
#!/usr/bin/env ruby
X = ["name", "rm", "ip", "127.0.0.1", "port", "6379", "name", "rz", "ip", "127.0.0.1", "port", "6379"]
h = Hash[X.each_slice(2).to_a]
print h['name']
@pixie79
pixie79 / SHIP
Created January 8, 2014 10:01
SHIP pig file
DEFINE my_cmd `tmp/test.tar.gz` SHIP ('tmp/test.tar.gz');
SH `tar -zxf tmp/test.tar.gz`
@pixie79
pixie79 / word_count_kafka.clj
Created November 27, 2013 15:26
Exception in thread "main" java.lang.ClassCastException: Cannot cast clojure.lang.PersistentList to storm.kafka.KafkaConfig$BrokerHosts, compiling:(word_count_kafka.clj:26)
(ns storm.starter.clj.word-count-kafka
(:import ;[backtype.storm StormSubmitter LocalCluster]
[storm.kafka KafkaConfig HostPort KafkaSpout SpoutConfig StringScheme])
(:use [backtype.storm clojure config])
(:gen-class))
(def ^{:private true}
host (list "localhost:9092"))
(def ^{:private true