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
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
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
# 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
class package::install( $packages = hiera_hash('packages', {} ) ) | |
{ | |
if( $packages ) | |
{ | |
create_resources( package, $packages ) | |
} | |
} |
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
[main] | |
logdir=/var/log/puppet | |
vardir=/var/lib/puppet | |
ssldir=/var/lib/puppet/ssl | |
rundir=/var/run/puppet | |
factpath=$vardir/lib/facter | |
templatedir=$confdir/templates | |
prerun_command=/etc/puppet/etckeeper-commit-pre | |
postrun_command=/etc/puppet/etckeeper-commit-post |
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
12:52 < Freeaqingme> Does anybody know if there are ubuntu baseboxes available that run puppet v3 ? | |
12:55 < adaro> wasn't puppet 3 discontinued or something | |
12:56 < Freeaqingme> huh | |
12:56 < Freeaqingme> it's in RC stage | |
12:56 < Freeaqingme> so stable coming up soon. | |
12:56 < Freeaqingme> at least that's what I know | |
12:56 < zipkid> It is. | |
12:56 < zipkid> 2.7.19 is the current v. | |
12:57 < Freeaqingme> yeah, but we're setting up a new infrastructure from scratch. So figured we might as well go for 3 | |
12:57 < zipkid> Freeaqingme: it's just a question of removing the current puppet and installing the new v from yum.puppetlabs.com no sweat. |
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
--- | |
:hierarchy: | |
- common | |
:backends: | |
- puppet | |
:puppet: | |
datasource: data |
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
$test_var = hiera('test_var',undef) | |
$cont = inline_template( "<% if @test_var %>test_var : <%= test_var %><% end %>" ) | |
notify{ "This is test_var '$test_var' - template $cont": } |
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
# Stages | |
stage { 'repo': before => Stage[package] } | |
stage { 'package': before => Stage[main] } | |
stage { 'post': require => Stage[main] } | |
class{ 'hiera_package': stage => package } |