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
$url_hash = { | |
'public_protocol' => pick($public_protocol,'http'), | |
'public_address' => pick($public_address,'127.0.0.1'), | |
'compute_port' => pick($compute_port, '8774'), | |
'compute_version' => pick($compute_version,'v2'), | |
} | |
$url = "${url_hash['public_protocol']}://${url_hash['public_address']}:${url_hash['compute_port']}/${url_hash['compute_version']}/${tenant_id}s" |
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
# This is what a test would look like. | |
require 'spec_helper_acceptance' | |
describe 'some class' do | |
it 'does stuff' do | |
pp=<<-EOS | |
notify { 'done stuff spec': | |
message => 'This message should appear', | |
} | |
EOS |
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
node 'agent' { | |
$file_count = '100' | |
$backend = 'concat' | |
$content = "test1\n" | |
each(range('1',$file_count)) |$file_num| { | |
case $backend { | |
'concat': { | |
concat { "/tmp/frag_${file_num}": | |
ensure => present, |
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
[1] pry(#<RSpec::Core::ExampleGroup::Nested_1::Nested_1::Nested_2::Nested_2>)> cd subject | |
[2] pry(#<Puppet::Resource::Catalog>):1> puts resource("File[/dne/_etc_haproxy_haproxy.cfg/fragments/10_haproxy-base]")[:content] | |
global | |
chroot /var/lib/haproxy | |
daemon | |
group haproxy | |
log 10.10.10.10 local0 | |
maxconn 4000 | |
pidfile /var/run/haproxy.pid | |
stats socket /var/lib/haproxy/stats |
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
define some_define ( | |
$listening_service, | |
$haproxy_acl, | |
#... | |
) { | |
concat::fragment { "HAProxy ACL for ${listening_service} from ${name}": | |
order => "20-${listening_service}-01-acl", | |
target => '/etc/haproxy/haproxy.cfg', | |
content => " acl ${haproxy_acl}\n", | |
} |
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
--- | |
language: ruby | |
bundler_args: --without development | |
script: "bundle exec rake validate && bundle exec rake lint && bundle exec rake spec SPEC_OPTS='--color --format documentation'" | |
matrix: | |
fast_finish: true | |
include: | |
- rvm: 1.8.7 | |
env: PUPPET_GEM_VERSION="~> 2.7.0" FACTER_GEM_VERSION="~> 1.6.0" | |
- rvm: 1.8.7 |
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
confine :true => begin | |
a = Puppet::Node::Facts.indirection | |
a.terminus_class = :network_device | |
a.find(Puppet::Indirector::Request.new(:facts, :find, "clustered", nil)) | |
rescue | |
:false | |
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
#!/usr/bin/env bash | |
line="" | |
started="" | |
rm botfile | |
mkfifo botfile | |
tail -f botfile | nc irc.cat.pdx.edu 6667 | while true ; do | |
if [ -z $started ] ; then | |
echo "USER bdbot 0 bdbot :I iz a bot" > botfile | |
echo "NICK bdbot" >> botfile |
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
[root@iau7gk8wy0bmy5p firewall]# cat test.rb | |
$: << '/etc/puppet/modules/firewall/lib' | |
require 'ruby-prof' | |
require 'facter' | |
require 'puppet' | |
# Profile the code | |
RubyProf.start | |
Puppet::Resource.indirection.search('firewall') |
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
require 'spec_helper_acceptance' | |
describe 'ntp class' do | |
it "applies idempotently" do | |
pp = "class { 'ntp': }" | |
apply_manifest(pp, :catch_failures => true) | |
apply_manifest(pp, :catch_changes => true) | |
end | |
describe file("/etc/ntp.conf") do | |
it { should be_file } |