Skip to content

Instantly share code, notes, and snippets.

View GregSutcliffe's full-sized avatar

Greg "Gwmngilfen" Sutcliffe GregSutcliffe

  • Red Hat
  • Scotland
View GitHub Profile
require 'json'
require 'rest-client'
require 'pp'
def get_foreman_array(path, options = { })
options[:foreman] ||= "foreman.office.etvinteractive.com"
options[:protocol] ||= "https"
options[:user] ||= "you know"
options[:pass] ||= "these values"
@GregSutcliffe
GregSutcliffe / gist:2503242
Created April 26, 2012 21:04
Gitolite config example
class test {
# Create the admin repo in the inital call, using defaults
class { 'gitolite': }
# Optionally override with your own config and keys
#class { 'gitolite': }
# authfile => 'puppet:///modules/test/admin.conf',
# keydir => 'puppet:///modules/test/admin-keys',
#}
#!/bin/bash
#
# IRC notification post-receive hook.
# Based on https://wiki.icinga.org/display/community/GIT+Commit+Bot
#
# Author: Mikael Fridh <frimik@gmail.com>
# Modified by: Greg Sutcliffe <gsutcliffe@ibahn.com
#
# This script pulls out the commit information and sends it to
# the RemoteCtl plugin in rbot via quassel.office:7268 using
Rename UUID host "testcore1" to "gsscore2". We get a popup:
Conflicts have been detected
The following entries were found conflicting with what foreman wanted to apply.
Please review them carefully, if you are certain that they should be removed, please click on overwrite.
DNS PTR Record 192.168.100.56/testcore1.devops.office.etvinteractive.com already exists
Additionally, we are about to perform the following actions
Remove DNS record for testcore1.devops.office.etvinteractive.com
cat > /etc/apache2/sites-available/archiso << EOF
Listen 23575
<VirtualHost *:23575>
ServerAdmin webmaster@localhost
DocumentRoot /srv/archiso/mnt
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
Name: "Arch AIF Profile"
Template kind: "script"
Content:
# We'd like to use this, but Foreman parses backslashed URLs
#MIRROR='< % = @mediapath % >'
# Simple repo call
MIRROR='ftp://mirrors.kernel.org/archlinux/$repo/os/$arch'
# Apt-cacher approach
PXE: (note language and keymap settings)
default linux
label linux
kernel <%= @kernel %>
append initrd=<%= @initrd %> interface=auto url=<%= foreman_url("provision")%> ramdisk_size=10800 root=/dev/rd/0 rw auto=true priority=critical hostname=unassigned-hostname DEBCONF_DEBUG=5 language=en locale=en_GB.UTF-8 console-keymaps-at/keymap=gb debian-installer/country=GB
Preseed:
# Locale, country and keyboard settings
@GregSutcliffe
GregSutcliffe / schedule.rb
Created June 5, 2012 09:04
Schedules patch
--- puppet-2.7.11.orig/lib/puppet/type/schedule.rb
+++ puppet-2.7.11/lib/puppet/type/schedule.rb
@@ -315,6 +315,7 @@
def self.mkdefaultschedules
result = []
+ return result
Puppet.debug "Creating default schedules"
result << self.new(
# Wrapper class to handle the parameterized classes needed
# by our infrastructure.
class puppetserver {
# 1st is prod server, 'default' is the dev server
case $::fqdn {
'puppetserver.office.etvinteractive.com': {
# Initialize the gitolite repo and puppet server
class { '::gitolite':
authfile => 'puppet:///modules/puppetserver/gitolite/production.conf',
# Simple keyboard
d-i debian-installer/locale string en_US
d-i console-tools/archs skip-config
# Network configuration
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string <%= @host.name %>
d-i netcfg/get_domain string <%= @host.domain.name %>
d-i netcfg/wireless_wep string