Skip to content

Instantly share code, notes, and snippets.

View trlinkin's full-sized avatar

Thomas Linkin trlinkin

View GitHub Profile
@trlinkin
trlinkin / case.pp
Last active October 14, 2016 13:55
case $facts['os']['family'] {
'debian': {
$x11_pkg = 'xorg'
$ssh_pkg = 'ssh'
}
'solaris': {
$x11_pkg = 'x11/server/xorg'
$ssh_pkg = 'network/ssh'
}
'windows': {
@trlinkin
trlinkin / repo.pp
Last active October 13, 2016 18:05
yumrepo { 'updates':
ensure => 'present',
descr => 'CentOS-$releasever - Updates',
enabled => '1',
gpgcheck => '1',
gpgkey => 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7',
mirrorlist => 'http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infra',
}
@trlinkin
trlinkin / shmergle_blurg.rb
Created January 12, 2016 22:34
crappy classifier stuff
require 'optparse'
require 'puppetclassify'
require 'yaml'
namespace :classify do
ARGV.delete "--"
##
## Example execution: rake classify:create_env_group -- -p'Parent Group' --name='App Test Group' --e='my_env'
@trlinkin
trlinkin / .editorconfig
Created November 17, 2015 16:53
Editorconfig heavy handed boilerplate - http://editorconfig.org/
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
@trlinkin
trlinkin / Rakefile
Last active November 30, 2015 18:56
Simple Boilerplate Rakefile for Puppet Module testing
require 'puppetlabs_spec_helper/rake_tasks'
require 'puppet-lint/tasks/puppet-lint'
desc "Validate Puppefile with R10k"
task :puppetfile do
begin
require 'r10k'
sh "r10k puppetfile check"
rescue LoadError => e
warn "Skipping Puppetfile validation; the r10k gem was not found"
require 'json'
require 'net/http'
require 'uri'
require 'openssl'
environment_path = ARGV[0] || Dir.pwd
new_only = ARGV[1] || false
def forge_request(forge_name)
@trlinkin
trlinkin / .bundle_config
Created May 15, 2015 20:18
This goes in your ~/.bundle/config
---
BUNDLE_PATH: .bundle
BUNDLE_DISABLE_SHARED_GEMS: "1"
@trlinkin
trlinkin / stages.pp
Created February 25, 2015 18:48
What the hell Run Stages
stage {'1':} -> Stage['main']
class first {
notify {'simulated change':}
}
class second {
exec { '/bin/echo "I should not have run"':
refreshonly => true,
logoutput => true,
ini_setting { "master_hiera_config":
ensure => present,
path => '/etc/puppetlabs/puppet/puppet.conf',
section => 'main',
setting => 'hiera_config',
value => '$environmentpath/production/hiera.yaml',
}
@trlinkin
trlinkin / pipeline-0.sh
Last active August 29, 2015 14:07
Jenkins Pipeline Scripts
#!/bin/bash
set -e
# The Git plugin should be told to clone the module repository to a directory
# by the same name as the module. We will do most of our work from within the
# the module's working directory.
cd ntp
# Select Ruby version using RVM