This file contains hidden or 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
# global defaults | |
# backup file changes to the puppet server | |
# Only for complete files managed by puppet! | |
filebucket { 'puppet': | |
server => puppet | |
} | |
File { | |
backup => 'puppet', |
This file contains hidden or 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 ( | |
$project_code, | |
$site = '' | |
) { | |
if $site == '' { | |
$use_site = "${project_code}-blah" | |
} | |
else { | |
$use_site = $site |
This file contains hidden or 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
cat > /etc/yum.repos.d/puppetlabs.repo << EOM | |
[puppetlabs] | |
name=puppetlabs | |
baseurl=http://yum.puppetlabs.com/el/6/products/\$basearch | |
#baseurl=http://yum.puppetlabs.com/el/6/devel/\$basearch | |
enabled=1 | |
gpgcheck=0 | |
EOM | |
cat > /etc/yum.repos.d/puppetlabs-dev.repo << EOM |
This file contains hidden or 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
def execute(command) | |
debug=false | |
puts " - Executing: #{command}" if debug | |
result = {:stdout => [], :stderr => [], :all => []} | |
Open3.popen3(command) do |stdin, stdout, stderr| | |
result[:stdout] += stdout.readlines | |
result[:stderr] += stderr.readlines | |
result[:all] += result[:stdout] + result[:stderr] | |
end |
This file contains hidden or 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
./json | |
./json/lib | |
./json/lib/json | |
./json/lib/json/common.rb | |
./json/lib/json/pure | |
./json/lib/json/pure/generator.rb | |
./json/lib/json/pure/parser.rb | |
./json/lib/json/pure.rb | |
./json/lib/json/version.rb | |
./json/lib/json.rb |
This file contains hidden or 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@vooitop ~]# puppet apply test.pp | |
Warning: Config file /etc/puppet/hiera.yaml not found, using Hiera defaults | |
Notice: bar 1 - baz | |
Notice: /Stage[main]/Foo/Notify[bar 1 - baz ]/message: defined 'message' as 'bar 1 - baz ' | |
Notice: Finished catalog run in 0.05 seconds |
This file contains hidden or 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 facter::package ( $version = 'installed' ) { | |
package { 'facter' | |
ensure => $version; | |
} | |
} | |
This will lookup the version in Hiera | |
facter::package::version: 1.6 |
This file contains hidden or 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
an_array: | |
- elem1 | |
- elem2 | |
a_hash: | |
key1: val1 | |
key2: | |
- key2arrayelem1 | |
- key2arrayelem2 |
This file contains hidden or 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
# Rakefile | |
require 'rubygems' | |
desc "Run puppet-lint." | |
task :lint do |t, args| | |
begin | |
require 'puppet-lint' | |
rescue LoadError | |
fail "Cannot load puppet-lint, please install gem : # gem install puppet-lint" | |
end |
This file contains hidden or 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
#!/bin/sh | |
syntax_errors=0 | |
error_msg=$(mktemp /tmp/error_msg.XXXXXX) | |
if git rev-parse --quiet --verify HEAD > /dev/null | |
then | |
against=HEAD | |
else | |
# Initial commit: diff against an empty tree object |