Skip to content

Instantly share code, notes, and snippets.

View ccaum's full-sized avatar

Carl Caum ccaum

  • Amazon Web Services
  • Portland, OR
  • X @ccaum
View GitHub Profile
vsphere_vm { '/opdx1/vm/eng/sample':
ensure => running,
source => '/opdx1/vm/eng/source',
memory => 1024,
cpus => 1,
}
@ccaum
ccaum / role.pp
Last active August 29, 2015 14:25
class myapplication::db::role {
include profile::common
include profile::application::db
include profile::mysql
}
require 'puppet/node/facts'
require 'puppet/indirector/store_configs'
class Puppet::Node::Facts::Satellite < Puppet::Indirector::StoreConfigs
desc "Save facts to Satellite's Foreman component and the store_configs backend.
It does not retrieve facts from Foreman."
def save(request)
raise "satellite: #{request.info}"
super(request)
@ccaum
ccaum / port_channel.pp
Last active August 29, 2015 14:20
NetDev Example
network_interface { 'Ethernet1':
enable => true,
description => 'Port channel link',
duplex => 'full',
speed => '10g',
mtu => 9000,
}
network_interface { 'Ethernet2':
enable => true,
@ccaum
ccaum / gist:14e71249cd911c4532a4
Created January 13, 2015 19:11
Satellite + PE Kickstart Default
<%#
kind: provision
name: Satellite Kickstart Default
oses:
- Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 6
- Red Hat Enterprise Linux 7
%>
<%
rhel_compatible = @host.operatingsystem.family == 'Redhat' && @host.operatingsystem.name != 'Fedora'
@ccaum
ccaum / noop.rb
Created September 12, 2013 20:09
This custom function will return true or false based on whether the puppet run is in noop mode or not. Call in the Puppet DSL with noop()
#Usage: noop() in Puppet DSL. Returns true/false
module Puppet::Parser::Functions
newfunction(:noop, :type => :rvalue) do |args|
Puppet[:noop]
end
end
file { 'C:/tomcat/webapps/app.war':
ensure => file,
source => 'puppet:///modules/myapp/app.war',
notify => Service['myapp'],
}
service { 'myapp':
ensure => running,
enable => true,
}
@ccaum
ccaum / apache.pp
Last active December 14, 2015 00:09
class apache {
package { 'httpd':
ensure => installed,
}
service { 'httpd':
ensure => running,
require => Package[httpd],
}
[Fri Oct 26 19:46:12 2012] [error] cgid daemon process died, restarting
[ pid=17253 file=ext/apache2/Hooks.cpp:727 time=2012-10-26 20:00:04.907 ]:
Unexpected error in mod_passenger: Could not connect to the ApplicationPool server: Broken pipe (32)
Backtrace:
(empty)
[ pid=17253 file=ext/apache2/Hooks.cpp:727 time=2012-10-26 20:42:46.581 ]:
Unexpected error in mod_passenger: Could not connect to the ApplicationPool server: Broken pipe (32)
Backtrace:
(empty)
@ccaum
ccaum / readings.yaml
Created September 20, 2012 06:38
Find four lowest temperature readings across all locations
---
- 10:
time: 2012-09-19 23:06:29.112718 -07:00
location: location_a
- 8:
time: 2012-09-19 23:06:19.112718 -07:00
location: location_a
- 7:
time: 2012-09-19 23:06:09.112718 -07:00
location: location_a