Skip to content

Instantly share code, notes, and snippets.

View petems's full-sized avatar
🏠
Working from home

Peter Souter petems

🏠
Working from home
View GitHub Profile
@petems
petems / Vagrantfile
Created February 4, 2015 14:04
Windows Beaker Vagrantfile
Vagrant.configure("2") do |c|
c.vm.define 'win-2008R2-std' do |v|
v.vm.hostname = 'win-2008R2-std'
v.vm.box = 'opentable/win-2008r2-standard-amd64-nocm'
v.vm.box_check_update = 'true'
v.vm.network :private_network, ip: "10.255.174.15", :netmask => "255.255.0.0", :mac => "080027E855B5"
v.vm.network :forwarded_port, guest: 3389, host: 3389
v.vm.network :forwarded_port, guest: 5985, host: 5985, id: 'winrm', auto_correct: true
v.vm.guest = :windows
v.vm.provider :virtualbox do |vb|
@petems
petems / Beaker.log
Created February 3, 2015 09:46
Full FreeBSD Log
BEAKER_debug=true bundle exec rspec spec/acceptance/ini_setting_spec.rb
/opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/beaker-rspec-5.0.1/lib/beaker-rspec/helpers/serverspec.rb:43: warning: already initialized constant Module::VALID_OPTIONS_KEYS
/opt/rubies/2.1.2/lib/ruby/gems/2.1.0/gems/specinfra-2.12.3/lib/specinfra/configuration.rb:4: warning: previous definition of VALID_OPTIONS_KEYS was here
Hypervisor for freebsd-9-x64 is vagrant
Beaker::Hypervisor, found some vagrant boxes to create
==> freebsd-9-x64: VM not created. Moving on...
created Vagrantfile for VagrantHost freebsd-9-x64
Bringing machine 'freebsd-9-x64' up with 'virtualbox' provider...
==> freebsd-9-x64: Importing base box 'freebsd-9-x64-vbox'...
==> freebsd-9-x64: Matching MAC address for NAT networking...
@petems
petems / Notes.md
Created January 21, 2015 15:54
OSX Vagrant Stuff

OSX Vagrant Notes

OSX Vagrant notes to take along the way as I get beaker working with boxen

@petems
petems / init.pp
Created January 15, 2015 20:36
Stopping stdlib validate_cmd from running in rspec
class validate_cmd_rspec {
file {'/etc/haproxy/haproxy.cfg':
ensure => present,
content => template('validate_cmd_rspec/etc/haproxy/haproxy.cfg.erb'),
}
if versioncmp($::puppetversion, '3.5') >= 0 {
File[$sudoers_user_file] { validate_cmd => '/usr/sbin/haproxy -f % -c', }
}
else {
@petems
petems / gist:d686a656a43e18cc7db4
Created January 15, 2015 19:53
Mocking validate_cmd in Puppet
require 'spec_helper'
describe 'sudo::sudoers', :type => :define do
let(:title) { 'world.domination' }
if (Puppet.version >= '3.5.0')
context "validating content with puppet #{Puppet.version}" do
let(:params) { { :users => ['joe'] } }
let(:facts) {{ :puppetversion => Puppet.version }}
@petems
petems / gist:718e5667c5ed3e284f77
Last active August 29, 2015 14:07
Beaker test results
peterso@name ~/Projects/puppet-uchiwa (master=) $ git co add_beaker_tests
Branch add_beaker_tests set up to track remote branch add_beaker_tests from petems.
Switched to a new branch 'add_beaker_tests'
peterso@name ~/Projects/puppet-uchiwa (add_beaker_tests=) $ bundle exec rake beaker
/opt/rubies/2.0.0-p451/bin/ruby -S rspec spec/acceptance --color
Hypervisor for ubuntu-server-12042-x64 is vagrant
Beaker::Hypervisor, found some vagrant boxes to create
created Vagrantfile for VagrantHost ubuntu-server-12042-x64
Bundler is using a binstub that was created for a different gem.
This is deprecated, in future versions you may need to `bundle binstub vagrant` to work around a system/bundle conflict.
@petems
petems / gist:6efe987bfcc122fc11fa
Created September 22, 2014 23:37
Beaker Docker error
RUN yum install -y wget ntpdate rubygems ruby-augeas ruby-devel augeas-devel
RUN touch /etc/sysconfig/network
EXPOSE 22
CMD ["/sbin/init"]
/opt/rubies/2.0.0-p451/lib/ruby/gems/2.0.0/gems/docker-api-1.13.2/lib/docker/connection.rb:52:in `rescue in request': read timeout reached (Docker::Error::TimeoutError)
from /opt/rubies/2.0.0-p451/lib/ruby/gems/2.0.0/gems/docker-api-1.13.2/lib/docker/connection.rb:36:in `request'
from /opt/rubies/2.0.0-p451/lib/ruby/gems/2.0.0/gems/docker-api-1.13.2/lib/docker/connection.rb:57:in `block (2 levels) in <class:Connection>'
from /opt/rubies/2.0.0-p451/lib/ruby/gems/2.0.0/gems/docker-api-1.13.2/lib/docker/image.rb:153:in `build'
from /opt/rubies/2.0.0-p451/lib/ruby/gems/2.0.0/bundler/gems/beaker-3aafc71dc284/lib/beaker/hypervisor/docker.rb:26:in `block in provision'
@petems
petems / gist:7878cfd4401012d9b051
Created September 22, 2014 20:27
First time beaker setup
Go here:
https://github.com/garethr/puppet-module-skeleton
Get the skeleton
Then generate a new module
puppet module yourname-nameofmodule
@petems
petems / gist:16607146d42be8747d9b
Created September 11, 2014 13:52
Log from Cloudtunes docker
peterso@name ~/Projects/cloudtunes (master *=) $ docker build --tag=cloudtunes-img .
Sending build context to Docker daemon 28.06 MB
Sending build context to Docker daemon
Step 0 : FROM dockerfile/ubuntu
Pulling repository dockerfile/ubuntu
c05eb8a58dd8: Download complete
511136ea3c5a: Download complete
b3553b91f79f: Download complete
ca63a3899a99: Download complete
ff01d67c9471: Download complete
@petems
petems / gist:e4271a59d8bae128ceec
Last active August 29, 2015 14:05
FOG get IP script
#!/usr/bin/env ruby
require 'rubygems' # required for Ruby 1.8.x
require 'bundler/setup'
require 'fog'
@service = Fog::Compute.new(
provider: 'rackspace',
rackspace_username: Fog.credentials[:rackspace_username],
rackspace_api_key: Fog.credentials[:rackspace_api_key],