This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Download PE tarball, extract to the same location as the Vagrantfile and mv | |
# to a directory called 'pe37'. Place a PE3 answers file called 'answers.txt' | |
# in the same location as the Vagrantfile (you can steal the | |
# all-in-one.answers.txt from the installer's answers/ directory). Run `vagrant | |
# up` and wait for PE to install. Visit https://localhost:4443 to view the PE | |
# console. | |
Vagrant.configure("2") do |config| | |
config.vm.define 'master' do |node| | |
node.vm.box = "puppetlabs/ubuntu-14.04-64-nocm" | |
node.vm.hostname = 'master.localdomain' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vagrant.configure('2') do |config| | |
# Specify box files | |
config.vm.box = 'precise32' | |
config.vm.box_url = 'http://files.vagrantup.com/precise32.box' | |
# Create web frontend | |
config.vm.define 'web.example.com' do |node| | |
node.vm.network :forwarded_port, guest: 443, host: 4443 | |
node.vm.network :forwarded_port, guest: 80, host: 8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[2] pry(main)> require 'facter' | |
=> true | |
[3] pry(main)> Facter.value(:manufacturer) | |
=> nil | |
[4] pry(main)> Facter.fact(:manufacturer).stubs(:value).returns("aoeu") ; Facter.value(:manufacturer) | |
Mocha::StubbingError: stubbing method on nil: nil.value | |
from (pry):4:in `__pry__' | |
[5] pry(main)> Facter.add(:manufacturer) do "snth" end ; Facter.fact(:manufacturer).stubs(:value).returns("aoeu") ; Facter.value(:manufacturer) | |
=> "aoeu" | |
[6] pry(main)> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Make a directory like this for each version you want | |
vv% ls -l ~/local/share/rbenv/gemsets | |
total 0 | |
drwxr-xr-x 8 hunner staff 272 Apr 22 15:06 vagrant_1.0.7/ | |
drwxr-xr-x 8 hunner staff 272 Apr 22 15:12 vagrant_1.2.2/ | |
## Put this in vagrant_*/Gemfile | |
vv% cat vagrant_1.2.1/Gemfile | |
source 'https://rubygems.org' | |
gem 'vagrant', :path => File.expand_path('vagrant', File.dirname(__FILE__)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## modules/revoke_cert/lib/reports/revoke_cert.rb | |
require 'puppet/face' | |
Puppet::Reports.register_report(:revoke_cert) do | |
def process | |
if self.status == 'unchanged' | |
Puppet::Face[:certificate, :current].destroy(self.host,{:ca_location => :local}) | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Hook to update the /etc/puppetlabs/puppet with the lastest git changes. | |
# Licensed Apache 2.0 | |
# | |
# To enable this hook, name this file "post-receive". | |
syncuser="puppetsync" | |
gituser="gitolite" | |
gitserver="hostname.example.com" | |
gitrepo="puppet.git" | |
destination="/etc/puppetlabs/puppet/environments" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Spell | |
let spell_executable = "aspell" | |
let spell_language_list = "spanish,english" | |
set spelllang=en_us,eo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## lib/puppet/indirector/node/hiera.rb | |
require 'puppet/node' | |
require 'puppet/indirector/code' | |
require 'hiera' | |
class Puppet::Node::Hiera < Puppet::Indirector::Code | |
desc 'Return a collection of classes and parameters by querying hiera for "classes" and "parameters" data entries.' | |
def find(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
vv% cd Documents/work/git/soupkitchen | |
vv% vagrant status | |
/Users/hunner/Documents/work/git/soupkitchen/lib/oscar/networking.rb:8:in `initialize': undefined method `[]' for nil:NilClass (NoMethodError) | |
from /Users/hunner/Documents/work/git/soupkitchen/lib/oscar/environment.rb:13:in `new' | |
from /Users/hunner/Documents/work/git/soupkitchen/lib/oscar/environment.rb:13:in `run!' | |
from /Users/hunner/Documents/work/git/soupkitchen/lib/oscar.rb:7:in `load!' | |
from /Users/hunner/Documents/work/git/soupkitchen/Vagrantfile:5:in `<top (required)>' | |
from /Users/hunner/.rvm/gems/ruby-1.9.3-p286/gems/vagrant-1.0.5/lib/vagrant/config/loader.rb:115:in `load' | |
from /Users/hunner/.rvm/gems/ruby-1.9.3-p286/gems/vagrant-1.0.5/lib/vagrant/config/loader.rb:115:in `block in procs_for_source' | |
from /Users/hunner/.rvm/gems/ruby-1.9.3-p286/gems/vagrant-1.0.5/lib/vagrant/config.rb:41:in `block in capture_configures' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class sysctl { | |
# nested class/define. Don't do this at home ;) | |
define conf ( | |
$value, | |
$ensure='present' | |
) { | |
include sysctl | |
$key = $name | |
if $ensure == 'present' { | |
augeas { "sysctl_conf/$key": |